【问题标题】:How can I deploy elasticsearch to kubernete?如何将 Elasticsearch 部署到 Kubernetes?
【发布时间】:2021-03-06 00:20:59
【问题描述】:

我在我的 Mac 上安装了minikube,我想在这个 k8s 集群上部署 elasticsearch。我遵循了这个指示:https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-elasticsearch.html

我创建的文件是:

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: quickstart
spec:
  version: 7.10.0
  nodeSets:
  - name: default
    count: 1
    config:
      node.store.allow_mmap: false

当我运行kubectl apply -f es.yaml 时,我得到了这个错误:error: unable to recognize "es.yaml": no matches for kind "Elasticsearch" in version "elasticsearch.k8s.elastic.co/v1"

它说kind 不匹配。我想知道我怎样才能让它工作。我搜索了 k8s 文档,似乎 kind 可以是 servicepoddeployment。但是为什么上面的指令使用Elasticsearch 作为kind?我应该指定kind 的什么值?

【问题讨论】:

    标签: docker elasticsearch kubernetes


    【解决方案1】:

    我认为您可能错过了安装 CRD 和 ElasticSearch 运算符的步骤。你有没有按照https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-eck.html这一步?

    ServicePodDeployment 等是 Kubernetes 原生资源。 Kubernetes 还提供了一种编写自定义资源的方法,使用 CRDsElasticsearch 就是这样一个例子,因此您必须在使用它之前定义自定义资源,以便 Kubernetes 理解这一点。

    【讨论】:

      猜你喜欢
      • 2023-02-21
      • 1970-01-01
      • 1970-01-01
      • 2020-09-21
      • 2017-03-10
      • 2019-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多