ECK部署ES过程记录

date
May 21, 2024
slug
k8s
author
status
Public
tags
Daily
summary
type
Post
thumbnail
category
updatedAt
May 22, 2024 09:02 AM

第一步-相关版本

 
k8s: 1.18
ECK: 1.9
 

第二步-安装相关crd以及eck operator

 
安装crd和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 logs -f statefulset.apps/elastic-operator
 

第三步-配置ES集群

先创建pvc:
cat <<EOF | kubectl apply -f -
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: elasticsearch-data-ragflow-
  namespace: elastic-system
spec:
  storageClassName: "nfs-client"
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 100Gi
EOF
cat <<EOF | kubectl apply -f -
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: ragflow
  namespace: elastic-system
spec:
  version: 8.11.3
  nodeSets:
  - name: default
    count: 1
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data # Do not change this name unless you set up a volume mount for the data path.
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 200Gi
        storageClassName: nfs-client
    config:
      node.store.allow_mmap: false
EOF
 
 

查看访问信息:

 
To access Elastic resources, the operator manages a default user named elastic with the superuser role. Its password is stored in a Secret named <name>-elastic-user.
kubectl get svc -n elastic-system

kubectl get secret hulk-es-elastic-user -o go-template='{{.data.elastic | base64decode }}'