eck-operator Installation with Helm
Elasticsearch, Kibana, APM Server, Enterprise Search, and Beats on Kubernetes
Deploy an eck-operator
Deploy an Elasticsearch
Deploy an Kibana
Kubernetes 1.19+
Helm 3.2.0+
A persistent storage resource and RW access to it
Kubernetes StorageClass for dynamic provisioning
helm repo add elastic https://helm.elastic.co
helm repo update
1. eck-operator installation
helm install elastic-operator elastic/eck-operator \
--create-namespace \
--namespace elastic-system
# Create Elasticsearch cluster
# - 1 master nodes
# - 2 data+ingest nodes
cat <<EOF | kubectl apply -f -
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: quickstart
namespace: elastic-system
spec:
version: 8.2.3
nodeSets:
# master nodes
- name: masters
count: 2
config:
node.roles: ["master"]
node.store.allow_mmap: false
# ingest-data nodes
- name: data
count: 3
config:
node.roles: ["data", "ingest"]
node.store.allow_mmap: false
EOF
PASSWORD=$(kubectl get secret quickstart-es-elastic-user -n elastic-system -o go-template='{{.data.elastic | base64decode}}')
ESURL=$(kubectl get -o jsonpath="{.spec.clusterIP}" services quickstart-es-http -n elastic-system)
curl -u "elastic:$PASSWORD" -k "https://$ESURL:9200"
cat <<EOF | kubectl apply -f -
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: quickstart
namespace: elastic-system
spec:
version: 8.2.3
count: 1
elasticsearchRef:
name: quickstart
EOF
clusterIP to NodePort (Option 1)
kubectl patch svc quickstart-kb-http -n elastic-system --type='json' -p '[{"op":"replace","path":"/spec/type","value":"NodePort"},{"op":"replace","path":"/spec/ports/0/nodePort","value":32076}]'
clusterIP to NodePort (Option 2)
cat <<'EOF' | kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
name: quickstart-kb-http-external
namespace: elastic-system
labels:
common.k8s.elastic.co/type: kibana
kibana.k8s.elastic.co/name: quickstart
spec:
ports:
- name: https
port: 5601
protocol: TCP
targetPort: 5601
nodePort: 32076
selector:
common.k8s.elastic.co/type: kibana
kibana.k8s.elastic.co/name: quickstart
sessionAffinity: None
type: NodePort
EOF
instance_public_ip="$(curl ifconfig.me --silent)"
echo "https://$instance_public_ip:32076"
echo "ID: elastic"
echo "PW: " $(kubectl get secret quickstart-es-elastic-user -n elastic-system -o go-template='{{.data.elastic | base64decode}}')
kubectl delete -n elastic-system \
serviceaccount/elastic-operator \
secret/elastic-webhook-server-cert \
clusterrole.rbac.authorization.k8s.io/elastic-operator \
clusterrole.rbac.authorization.k8s.io/elastic-operator-view \
clusterrole.rbac.authorization.k8s.io/elastic-operator-edit \
clusterrolebinding.rbac.authorization.k8s.io/elastic-operator \
service/elastic-webhook-server \
configmap/elastic-operator \
validatingwebhookconfiguration.admissionregistration.k8s.io/elastic-webhook.k8s.elastic.co
kubectl delete statefulset.apps/elastic-operator -n elastic-system
helm uninstall elastic-operator -n elastic-system
kubectl delete ns elastic-system
(Option) all-nodes