Deploying elasticsearch cluster on kubernetes issue


I am trying to deploy elasticsearch 7.7.1 on kubernetes into a 3 node cluster. I have tried following the documentation for it and when I run kubectl apply -f <manifestfile>.yaml I am getting the following error:

error: unable to recognize "<manifestfile>.yaml": no matches for kind "Elasticsearch" in version ""

the yaml file looks like this:

kind: Elasticsearch
  name: elasticsearch
  baseImage: registry/elasticsearch
  tag: v7.7.1
  version: 7.7.1
  - name: default
    count: 3
      node.master: true true true
          app: elasticsearch
        - name: elasticsearch
          image: registry/elasticsearch:v7.7.1
          - name: ES_JAVA_OPTS
            values: -Xms4g -Xmx4g
            memory: 4Gi
            cpu: 1
            memory: 5Gi
        - name: es-storage
          mountPath: /var/lib/elasticsearch
        - name: es-local-claim
            claimName: es-storage

Any idea what I am doing wrong?

I am not expert because I have never deployed Elasticsearch in k8s.

Nevertheless, it appears you may have missed some step in your deployment procedure. Kubernetes api complains about not being able to recognise the kind "Elasticsearch".

I suppose this happens because there has not been any CRDs created specifying this kind Elasticsearch.

My piece of advice, be sure you are not missing any step before creating the Elasticsearch object. Besides, could you share please the steps you are following to deploy Elasticsearch in kubernetes?

Hope it helps,

The quickstart documentation does not say anything about CRD's see

I think you have to deploy the operator first. Did u do it?

Great I have installed it via HELM and it's crashing because arm64 is not supported.

In the container registry of elastic there seems to be images arm64 compatible. Maybe you can deploy elasticsearch (if you dont want the whole stack nor ECK), running in k8s.

You could create a Deployment out of one of these images, configure its storage and inject the config with a ConfigMap.

Hope it helps,

Let's say I create a 3 node cluster using deployemnts and replica:3. how will I make those tree pods talk to eachother

I suppose that the best approach would be three different StatefulSets for each Elasticsearch pod, if you prefer it can be Deployments, instead.
Expose each Deployment and then make sure Service object uses ports 9200 and 9300. If you do not have 9300 cluster communication is not going to work.
Each of the pods is going to have a different PVC mounted in /var/lib/elasticsearch.

I think this is the best way to proceed, bearing in mind Elasticsearch is a Stateful application.

In fact I needed arm/v7 which it isn't. I am guessing I am about to build my own docker images for that architecture.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.