# Not able to create ES cluster with ECK1.9.1

**URL:** https://discuss.elastic.co/t/not-able-to-create-es-cluster-with-eck1-9-1/299206
**Category:** Elastic Cloud on Kubernetes (ECK)
**Created:** [March 9, 2022, 11:56am UTC](https://discuss.elastic.co/t/not-able-to-create-es-cluster-with-eck1-9-1/299206 "2022-03-09T11:56:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![NK2812](https://avatars.discourse-cdn.com/v4/letter/n/fbc32d/32.png) [@NK2812](https://discuss.elastic.co/u/NK2812)
#### Post date: [March 9, 2022, 11:56am UTC](https://discuss.elastic.co/t/not-able-to-create-es-cluster-with-eck1-9-1/299206/1 "2022-03-09T11:56:39Z")

</div>

Hi Team,

We trying to create ES-7.16.3 version cluster with ECK 1.9 but ECK is not creating the ES cluster. unfortunately I do not see any errors also in the eck logs.

I tried to create the es cluster using below config like kubectl apply -f es.yaml, then it says imagepullerror, authentication is required to pull the image and cluster will not come up.  
Now I run kubectl describe Elasticsearch/Elasticsearch-sample and if I see the content the entire podTemplate section is empty. that's why it is not getting the imagepullsecret from spec section.  
The problem I see is somehow ECK is removing the content of pod template and even config also empty.

Below is my ES cluster config file.

```auto
apiVersion: elasticsearch.k8s.elastic.co/v1beta1
kind: Elasticsearch
metadata:
  name: elasticsearch-sample
spec:
  version: 7.16.3
  image: ES-custom-image # We build this image with some plugin on top of ES image
  nodeSets:
    - name: master
      count: 3
      config:
        node.roles: ["master"]
        http.compression: true
        http.cors.enabled: true
        http.cors.allow-origin: "*"
        xpack.ml.enabled: false
      podTemplate:
        metadata:
          labels:
            elastic-cluster: "true"
        spec:
          imagePullSecrets:
            - name: imageregistrykey
          initContainers:
            - name: sysctl
              securityContext:
                privileged: true
              command: ['sh', '-c', 'sysctl -w vm.max_map_count=262144']
          containers:
            - name: elasticsearch
              resources:
                requests:
                  memory: 4Gi
                  cpu: 1
                limits:
                  memory: 4Gi
                  cpu: 1
              env:
                - name: ES_JAVA_OPTS
                  value: "-Dlog4j2.formatMsgNoLookups=true"
      volumeClaimTemplates:
        - metadata:
            name: elasticsearch-data
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 10Gi
            storageClassName: esstorageclass
    - name: data
      count: 2
      config:
        node.roles: ["data"]
        http.compression: true
        http.cors.enabled: true
        http.cors.allow-origin: "*"
        xpack.ml.enabled: false
      podTemplate:
        metadata:
          labels:
            elastic-cluster: "true"
        spec:
          imagePullSecrets:
            - name: imageregistrykey
          initContainers:
            - name: sysctl
              securityContext:
                privileged: true
              command: ['sh', '-c', 'sysctl -w vm.max_map_count=262144']
          containers:
            - name: elasticsearch
              resources:
                requests:
                  memory: 8Gi
                  cpu: 2
                limits:
                  memory: 8Gi
                  cpu: 2
              env:
                - name: ES_JAVA_OPTS
                  value: "-Dlog4j2.formatMsgNoLookups=true"
      volumeClaimTemplates:
        - metadata:
            name: elasticsearch-data
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 10Gi
            storageClassName: esstorageclass
  http:
    tls:
      selfSignedCertificate:
        disabled: true

```

when I try to see Elasticsearch config using kubectl describe Elasticsearch Elasticsearch-sample

```auto
$ k describe elasticsearch elasticsearch-sample -n eck-es-test1
Name: elasticsearch-sample
Namespace: eck-es-test1
Labels: <none>
Annotations: common.k8s.elastic.co/controller-version: 1.9.1
              elasticsearch.k8s.elastic.co/initial-master-nodes:
                elasticsearch-sample-es-master-0,elasticsearch-sample-es-master-1,elasticsearch-sample-es-master-2,elasticsearch-sample-es-data-0,elastics...
API Version: elasticsearch.k8s.elastic.co/v1
Kind: Elasticsearch
Metadata:
  Creation Timestamp: 2022-03-09T11:39:43Z
  Generation: 2
  Resource Version: 8262372
  UID: 1234
Spec:
  Auth:
  Http:
    Service:
      Metadata:
      Spec:
    Tls:
      Certificate:
      Self Signed Certificate:
        Disabled: true
  Image: es-custom-image
  Monitoring:
    Logs:
    Metrics:
  Node Sets:
    Config:
    Count: 3
    Name: master
    Pod Template:
      Metadata:
        Creation Timestamp: <nil>
      Spec:
        Containers: <nil>
    Volume Claim Templates:
      Metadata:
        Name: elasticsearch-data
      Spec:
        Access Modes:
          ReadWriteOnce
        Resources:
          Requests:
            Storage: 10Gi
        Storage Class Name: esstorageclass
      Status:
    Config:
    Count: 2
    Name: data
    Pod Template:
      Metadata:
        Creation Timestamp: <nil>
      Spec:
        Containers: <nil>
    Volume Claim Templates:
      Metadata:
        Name: elasticsearch-data
      Spec:
        Access Modes:
          ReadWriteOnce
        Resources:
          Requests:
            Storage: 10Gi
        Storage Class Name: esstorageclass
      Status:
  Transport:
    Service:
      Metadata:
      Spec:
    Tls:
      Certificate:
  Update Strategy:
    Change Budget:
  Version: 7.16.3
Status:
  Health: unknown
  Phase: ApplyingChanges
  Version: 7.16.3
Events: <none>

```

Why operator is removing the podTemplate section from nodeset ? any help would be appreciated.

Thanks

---

<div class="post-metadata">

### Author: ![Thibault\_Richard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thibault_richard/32/50513_2.png) [@Thibault\_Richard](https://discuss.elastic.co/u/Thibault_Richard)
#### Post date: [March 9, 2022, 6:34pm UTC](https://discuss.elastic.co/t/not-able-to-create-es-cluster-with-eck1-9-1/299206/2 "2022-03-09T18:34:33Z")

</div>

What version of k8s are you using?

Use `apiVersion: elasticsearch.k8s.elastic.co/v1` instead of `v1beta1` to fix your issue.

---

<div class="post-metadata">

### Author: ![NK2812](https://avatars.discourse-cdn.com/v4/letter/n/fbc32d/32.png) [@NK2812](https://discuss.elastic.co/u/NK2812)
#### Post date: [March 11, 2022, 4:22am UTC](https://discuss.elastic.co/t/not-able-to-create-es-cluster-with-eck1-9-1/299206/3 "2022-03-11T04:22:15Z")

</div>

Thank you @Thibault_Richard , somehow I missed this while reading the ECK documentation. Its working fine now after changing the apiVersion.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 8, 2022, 4:22am UTC](https://discuss.elastic.co/t/not-able-to-create-es-cluster-with-eck1-9-1/299206/4 "2022-04-08T04:22:48Z")

</div>

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