# Elasticsearch container resources not recognized

**URL:** <https://discuss.elastic.co/t/elasticsearch-container-resources-not-recognized/195015>\
**Category:** Elasticsearch\
**Created:** [August 13, 2019, 11:41am UTC](https://discuss.elastic.co/t/elasticsearch-container-resources-not-recognized/195015 "2019-08-13T11:41:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamamd](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@mohamamd](https://discuss.elastic.co/u/mohamamd)\
**Post date:** [August 13, 2019, 11:41am UTC](https://discuss.elastic.co/t/elasticsearch-container-resources-not-recognized/195015/1 "2019-08-13T11:41:17Z")

</div>

I have deployed the operator according to the following document and it is running fine. Then I created the following elastic search but the pods for elastic search is not getting created.

[https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-quickstart.html](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-quickstart.html)

```
# This sample sets up an Elasticsearch cluster with 3 nodes.
apiVersion: elasticsearch.k8s.elastic.co/v1alpha1
kind: Elasticsearch
metadata:
  name: elasticsearch-sample
spec:
  version: 7.2.0
  nodes:
  - config:
      # most Elasticsearch configuration parameters are possible to set, e.g:
      node.master: true
      node.data: true
      node.ingest: true
    podTemplate:
      metadata:
        labels:
          # additional labels for pods
          foo: bar
      spec:
        containers:
        - name: elasticsearch
          # specify resource limits and requests
          resources:
            limits:
              memory: 4Gi
            requests:
              memory: 2Gi
          env:
          - name: ES_JAVA_OPTS
            value: "-Xms2g -Xmx2g"
    nodeCount: 3
    volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 5Gi
        storageClassName: fastest

```

It gives the following error events:

```
Events:
  Type Reason Age From Message
  ---- ------ ---- ---- -------
  Warning Unexpected 2m34s (x132 over 7m34s) elasticsearch-controller Cannot create pod elasticsearch-sample-es-44qch28x27: pods "elasticsearch-sample-es-44qch28x27" is forbidden: failed quota: ns-elastic-system: must specify limits.memory,requests.memory
  Warning Unexpected 2m31s (x132 over 7m32s) elasticsearch-controller Cannot create pod elasticsearch-sample-es-44qch28x27: pods "elasticsearch-sample-es-44qch28x27" is forbidden: failed quota: ns-elastic-system: must specify limits.memory,requests.memory

```

FYI, I have Resourcequota in my namespace. But as the pod template of elasticsearch has memory resource specifically defined, I am confused why this "elasticsearch-controller" still getting this issue.

```
apiVersion: v1
kind: ResourceQuota
metadata:
  name: ns-elastic-system
  namespace: elastic-system
spec:
  hard:
    limits.memory: 25Gi
    persistentvolumeclaims: "10"
    requests.memory: 15Gi
    requests.storage: 100Gi
```

---

<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:** [September 10, 2019, 11:41am UTC](https://discuss.elastic.co/t/elasticsearch-container-resources-not-recognized/195015/2 "2019-09-10T11:41:23Z")

</div>

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