Download Elastic Cloud on Kubernetes | Elastic
ECK 官网链接

安装 ECK-Operator
kubectl create -f https://download.elastic.co/downloads/eck/1.9.1/crds.yaml

kubectl apply -f https://download.elastic.co/downloads/eck/1.9.1/operator.yaml
创建完成结果
kubectl -n elastic-system get all

NAME                     READY   STATUS    RESTARTS   AGE

pod/elastic-operator-0   1/1     Running   0          49s

NAME                             TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE

service/elastic-webhook-server   ClusterIP   10.43.125.198   <none>        443/TCP   49s

NAME                                READY   AGE

statefulset.apps/elastic-operator   1/1     50s
部署主从集群架构(在这之前需要先创建 storage class)
cat <<EOF | kubectl apply -f -
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: elastic
  namespace: eck
spec:
  version: 7.6.2
  nodeSets:
    - name: elastic-master
      count: 1
      config:
        node.master: true
        node.data: true
        node.ingest: true
        node.store.allow_mmap: false
      volumeClaimTemplates:
        - metadata:
            name: elasticsearch-data
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 10Gi
            storageClassName: openebs-hostpath
    - name: elastic-node
      count: 1
      config:
        node.master: false
        node.data: true
        node.ingest: true
        node.store.allow_mmap: false
      volumeClaimTemplates:
        - metadata:
            name: elasticsearch-data
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 10Gi
            storageClassName: openebs-hostpath
  http:
    service:
      spec:
        type: NodePort
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: kibana
  namespace: eck
spec:
  version: 7.6.2
  count: 1
  elasticsearchRef:
    name: "elastic"
  podTemplate:
    spec:
      containers:
        - name: kibana
          env:
            - name: NODE_OPTIONS
              value: "--max-old-space-size=2048"
          resources:
            requests:
              memory: 1Gi
              cpu: 1
            limits:
              memory: 2Gi
              cpu: 2
  http:
    service:
      spec:
        type: NodePort

EOF

ok,安装完成
在这里插入图片描述

访问 kibana

https://192.168.100.132:31665/login?next=%2F
在这里插入图片描述

#账户名称:elastic
获取密码
#密码
PASSWORD=$(kubectl -n eck get secret elastic-es-elastic-user -o=jsonpath=‘{.data.elastic}’ | base64 --decode)
echo $PASSWORD

输入控制台打印的密码
在这里插入图片描述
OK,没什么问题

删除卸载

kubectl -n eck delete kibana kibana

kubectl -n eck delete elasticsearch elastic

镜像无法下载问题解决:

docker pull elastic/elasticsearch:7.6.2

docker pull elastic/kibana:7.6.2

docker tag elastic/elasticsearch:7.6.2 docker.elastic.co/elasticsearch/elasticsearch:7.6.2

docker tag elastic/kibana:7.6.2 docker.elastic.co/kibana/kibana:7.6.2

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐