如何在 GKE 上安装 ECK,具有 2 个环境(生产和开发)

发布于 2025-01-09 20:55:38 字数 387 浏览 1 评论 0原文

我按照以下说明进行操作: https://www.elastic.co/guide/en/cloud-on-k8s/1.0/k8s-quickstart.html#k8s-deploy-elasticsearch。但我想知道如何区分用于生产的 ECK 和用于开发的 ECK 之间的安装。

  1. 我应该分别安装 Elasticsearch 运算符用于生产和开发吗?
  2. 弹性算子和弹性节点有什么关系?我如何知道哪个弹性运营商在开发环境中管理节点?

I follow instructions from : https://www.elastic.co/guide/en/cloud-on-k8s/1.0/k8s-quickstart.html#k8s-deploy-elasticsearch. But I am wondering how to differentiate the installation between ECK for production and ECK for development.

  1. Should I install Elasticsearch operator for production and development respectively?
  2. What is relation between elastic operator and elastic node? And how do I know which elastic operator manages a node in development environment?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白云悠悠 2025-01-16 20:55:38

我就是这样做的:

kubectl config set-context --current --namespace=default
kubectl create -f https://download.elastic.co/downloads/eck/2.4.0/crds.yaml
kubectl apply -f https://download.elastic.co/downloads/eck/2.4.0/operator.yaml

生产部署:

kubectl apply -f prod-depl.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: production
  labels:
    name: production
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: elasticsearch-data-prod
  namespace: production
  labels:
    type: local
spec:
  storageClassName: standard
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/mnt/data"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: elasticsearch-data-prod
  namespace: production
spec:
  storageClassName: standard
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: data-es
  namespace: production
spec:
  version: 8.4.3
  nodeSets:
    - name: default
      count: 1
      config:
        node.store.allow_mmap: false
      podTemplate:
        spec:
          containers:
            - name: elasticsearch
              # resources:
              #   limits:
              #     memory: 2Gi
              #     cpu: 2
              # env:
              #   - name: ES_JAVA_OPTS
              #     value: "-Xms2g -Xmx4g"
              volumeMounts:
                - name: elasticsearch-data-prod
                  mountPath: /usr/share/production/elasticsearch/data
      volumeClaimTemplates:
        - metadata:
            name: elasticsearch-data-prod
          spec:
            accessModes:
              - ReadWriteOnce
            storageClassName: standard
            resources:
              requests:
                storage: 10Gi

---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: data-kibana
  namespace: production
spec:
  version: 8.4.3
  count: 1
  elasticsearchRef:
    name: data-es

开发部署:

kubectl apply -f dev-depl.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: development
  labels:
    name: development
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: elasticsearch-data-dev
  namespace: development
  labels:
    type: local
spec:
  storageClassName: standard
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/mnt/data"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: elasticsearch-data-dev
  namespace: development
spec:
  storageClassName: standard
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: data-es
  namespace: development
spec:
  version: 8.4.3
  nodeSets:
    - name: default
      count: 1
      config:
        node.store.allow_mmap: false
      podTemplate:
        spec:
          containers:
            - name: elasticsearch
              # resources:
              #   limits:
              #     memory: 2Gi
              #     cpu: 2
              # env:
              #   - name: ES_JAVA_OPTS
              #     value: "-Xms2g -Xmx4g"
              volumeMounts:
                - name: elasticsearch-data-dev
                  mountPath: /usr/share/development/elasticsearch/data
      volumeClaimTemplates:
        - metadata:
            name: elasticsearch-data-dev
          spec:
            accessModes:
              - ReadWriteOnce
            storageClassName: standard
            resources:
              requests:
                storage: 1Gi

---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: data-kibana
  namespace: development
spec:
  version: 8.4.3
  count: 1
  elasticsearchRef:
    name: data-es

this is how I did it:

kubectl config set-context --current --namespace=default
kubectl create -f https://download.elastic.co/downloads/eck/2.4.0/crds.yaml
kubectl apply -f https://download.elastic.co/downloads/eck/2.4.0/operator.yaml

production deployment:

kubectl apply -f prod-depl.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: production
  labels:
    name: production
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: elasticsearch-data-prod
  namespace: production
  labels:
    type: local
spec:
  storageClassName: standard
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/mnt/data"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: elasticsearch-data-prod
  namespace: production
spec:
  storageClassName: standard
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: data-es
  namespace: production
spec:
  version: 8.4.3
  nodeSets:
    - name: default
      count: 1
      config:
        node.store.allow_mmap: false
      podTemplate:
        spec:
          containers:
            - name: elasticsearch
              # resources:
              #   limits:
              #     memory: 2Gi
              #     cpu: 2
              # env:
              #   - name: ES_JAVA_OPTS
              #     value: "-Xms2g -Xmx4g"
              volumeMounts:
                - name: elasticsearch-data-prod
                  mountPath: /usr/share/production/elasticsearch/data
      volumeClaimTemplates:
        - metadata:
            name: elasticsearch-data-prod
          spec:
            accessModes:
              - ReadWriteOnce
            storageClassName: standard
            resources:
              requests:
                storage: 10Gi

---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: data-kibana
  namespace: production
spec:
  version: 8.4.3
  count: 1
  elasticsearchRef:
    name: data-es

dev deployment:

kubectl apply -f dev-depl.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: development
  labels:
    name: development
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: elasticsearch-data-dev
  namespace: development
  labels:
    type: local
spec:
  storageClassName: standard
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/mnt/data"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: elasticsearch-data-dev
  namespace: development
spec:
  storageClassName: standard
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: data-es
  namespace: development
spec:
  version: 8.4.3
  nodeSets:
    - name: default
      count: 1
      config:
        node.store.allow_mmap: false
      podTemplate:
        spec:
          containers:
            - name: elasticsearch
              # resources:
              #   limits:
              #     memory: 2Gi
              #     cpu: 2
              # env:
              #   - name: ES_JAVA_OPTS
              #     value: "-Xms2g -Xmx4g"
              volumeMounts:
                - name: elasticsearch-data-dev
                  mountPath: /usr/share/development/elasticsearch/data
      volumeClaimTemplates:
        - metadata:
            name: elasticsearch-data-dev
          spec:
            accessModes:
              - ReadWriteOnce
            storageClassName: standard
            resources:
              requests:
                storage: 1Gi

---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: data-kibana
  namespace: development
spec:
  version: 8.4.3
  count: 1
  elasticsearchRef:
    name: data-es

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文