# Unable to create Elasticsearch Cluster

**URL:** <https://discuss.elastic.co/t/unable-to-create-elasticsearch-cluster/347336>\
**Category:** Elasticsearch\
**Created:** [November 16, 2023, 1:52pm UTC](https://discuss.elastic.co/t/unable-to-create-elasticsearch-cluster/347336 "2023-11-16T13:52:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esakki](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/esakki/32/126509_2.png) [@Esakki](https://discuss.elastic.co/u/Esakki)\
**Post date:** [November 16, 2023, 1:52pm UTC](https://discuss.elastic.co/t/unable-to-create-elasticsearch-cluster/347336/1 "2023-11-16T13:52:19Z")

</div>

@Sunile_Manjee ,

Hi there, due to some issue I deleted elasticsearch, kibana and APM deployment completely from my on-prem K8s cluster, now when try to create it's not creating any pods, I waited for 2 hours nothing is happening.. I tried mutiple time but it's not working? what to do, what could be the issue?  
step 1)

```auto
kubectl create -f https://download.elastic.co/downloads/eck/2.10.0/crds.yaml

```

step 2)

```auto
kubectl apply -f https://download.elastic.co/downloads/eck/2.10.0/operator.yaml

```

step 3)  
I applied my below elasticsearch.yaml file,

```auto
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: elasticsearch-nonprod
spec:
  version: 8.9.1
  http:
    tls:
      selfSignedCertificate:
        disabled: true
      certificate:
        secretName: esuatcert
    service:
      spec:
        type: LoadBalancer
        loadBalancerIP: myLB-IP
        ports:
          - name: https
            port: 443
            protocol: TCP
            targetPort: 9200
        selector:
          elasticsearch.k8s.elastic.co/cluster-name: "elasticsearch-nonprod"
          elasticsearch.k8s.elastic.co/node-master: "false"
  nodeSets:
  - name: master-nodes
    count: 3
    config:
      node.roles: ["master"]
      xpack.security.authc.api_key.enabled: true
    podTemplate:
      spec:
        initContainers:
        - name: sysctl
          securityContext:
            privileged: true
            runAsUser: 0
          command: ['sh', '-c', 'sysctl -w vm.max_map_count=262144']
          env:
            - name: ES_JAVA_OPTS
              value: -Xms1g -Xmx1g
            - name: bootstrap.memory_lock
              value: 'true'
    volumeClaimTemplates:
      - metadata:
          name: elasticsearch-data
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 2Gi
              cpu: 500m
              memory: 2Gi
            limits:
              cpu: 500m
              memory: 2Gi
          storageClassName: standard
  - name: elastic-data-nodes
    count: 3
    config:
      node.roles: ["data"]
      xpack.security.authc.api_key.enabled: true
    podTemplate:
      metadata:
        labels:
          app: elasticsearch
          data-node-type: "elasticsearch-standard-logging"
      spec:
        initContainers:
        - name: sysctl
          securityContext:
            privileged: true
            runAsUser: 0
          command: ['sh', '-c', 'sysctl -w vm.max_map_count=262144']
          env:
            - name: ES_JAVA_OPTS
              value: -Xms2g -Xmx2g
            - name: bootstrap.memory_lock
              value: 'true'
      volumeClaimTemplates:
        - metadata:
            name: elasticsearch-data
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 5Gi
                cpu: 2000m
                memory: 4Gi
              limits:
                cpu: 2000m
                memory: 4Gi
            storageClassName: standard
  - name: apm-data-nodes
    count: 3
    config:
      node.roles: ["data"]
      xpack.security.authc.api_key.enabled: true
    podTemplate:
      metadata:
        labels:
          app: elasticsearch
          data-node-type: "apm-data-logging"
      spec:
        initContainers:
        - name: sysctl
          securityContext:
            privileged: true
            runAsUser: 0
          command: ['sh', '-c', 'sysctl -w vm.max_map_count=262144']
          env:
            - name: ES_JAVA_OPTS
              value: -Xms2g -Xmx2g
            - name: bootstrap.memory_lock
              value: 'true'
      volumeClaimTemplates:
        - metadata:
            name: apm-elasticsearch-data
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 5Gi
                cpu: 2000m
                memory: 4Gi
              limits:
                cpu: 2000m
                memory: 4Gi
            storageClassName: standard

```

for your reference,

```auto
kubectl get elasticsearch -n k8s-elasticsearch-np
NAME HEALTH NODES VERSION PHASE AGE
elasticsearch-nonprod 130m

```

```auto
kubectl get events
No resources found in default namespace.

```

```auto
kubectl get events -n k8s-elasticsearch-np
No resources found in k8s-elasticsearch-np namespace.

```

---

<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:** [December 14, 2023, 1:52pm UTC](https://discuss.elastic.co/t/unable-to-create-elasticsearch-cluster/347336/2 "2023-12-14T13:52:29Z")

</div>

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