【问题标题】:ECK (Elastic Cloud on Kubernetes) restart container without using kubectl deleteECK(Kubernetes 上的弹性云)在不使用 kubectl delete 的情况下重启容器
【发布时间】:2021-11-20 08:20:04
【问题描述】:

有没有办法在不使用kubectl delete 的情况下重启 Elasticsearch 集群?

上下文是我无权运行任何cli命令(包括kubectl命令),我只能通过kustomize部署yaml文件。我现在想在现有容器中安装一个插件(摄取附件),但它只在容器初始化时安装。

对于其他类型的部署,我可以设置replica:0,然后将其设置回1 以模拟删除并重新启动,但对于kind:Elasticsearch,我无法将nodeSets 计数设置为0,否则会引发错误并且无法部署。

是否有任何可能的解决方法允许我在 Elasticsearch 容器上安装插件?

以下是 Elasticsearch yaml 文件:

apiVersion: elasticsearch.k8s.elastic.co/v1 
kind: Elasticsearch 
metadata: 
  name: elastic-test
spec: 
  version: 7.11.1
  auth:
    roles:
    - secretName: elastic-roles-secret
    fileRealm:
    - secretName: elastic-filerealm-secret
  nodeSets: 
  - name: default
    count: 1 
    config:
      node.store.allow_mmap: false 
    volumeClaimTemplates:
    - metadata:
        name: azure-pvc
      spec:
        storageClassName: ""
        accessModes:
        - ReadWriteMany
        resources:
          requests:
            storage: 25Gi
        volumeName: elasticsearch-azure-pv
    podTemplate:
      spec:
        initContainers:
        - name: install-plugins
          command:
          - sh
          - -c
          - |
            bin/elasticsearch-plugin install --batch ingest-attachment

【问题讨论】:

  • 你用的是哪个版本的 Kubernetes?
  • 客户端版本:v1.20.4,服务器版本:v1.18.10

标签: elasticsearch kubernetes elastic-cloud


【解决方案1】:

在为您的问题找到解决方案后,很遗憾地通知您,目前不使用您提到的方法重新启动集群似乎是不可能的。

this article 你可以找到这些方法。

Here你可以找到自定义配置文件和 Elasticsearch 插件。

另请参阅:thisthis 指南。

【讨论】:

  • 感谢您花时间研究我的问题,但很遗憾我之前已经看过这些资源,但无法解决我的问题。
  • 也许您尝试过使用 API Elasticsearch(确切地说是节点生命周期 API)重新启动集群? Here 例子。
【解决方案2】:

使用 ECK 作为操作符,您无需使用 rollout restart。应用您更新的 Elasticsearch 规范,操作员将为您执行滚动更新。

【讨论】:

    猜你喜欢
    • 2020-07-24
    • 2020-07-26
    • 2019-04-18
    • 2019-11-20
    • 2022-08-23
    • 2016-01-05
    • 2016-09-16
    • 1970-01-01
    • 2020-12-24
    相关资源
    最近更新 更多