Pod template and secureSettings fails with failed quota

Hello, I have a name space with a resource limits and when I try do deploy Elasticsearch it fails with:

create Pod ldap-test-3-es-55b787q5-0 in StatefulSet ldap-test-3-es-55b787q5 failed error: pods "ldap-test-3-es-55b787q5-0" is forbidden: failed quota: newp: must specify limits.cpu,limits.memory

If I remove the secureSettings from the config it deploys fine. Below is the yaml with kubectl.
At the moment I just testing ECK in a minikube instance.

---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: ldap-test-3
spec:
  nodeSets:
  - config:
      node.data: true
      node.ingest: true
      node.master: true
      node.store.allow_mmap: false
    count: 1
    name: 55b787q5
    podTemplate:
      spec:
        containers:
        - env:
          - name: ES_JAVA_OPTS
            value: "-Xms1g -Xmx1g"
          name: elasticsearch
          resources:
            limits:
              cpu: '2'
              memory: 2Gi
            requests:
              cpu: '1'
              memory: 2Gi
  secureSettings:
  - secretName: secure-bind-password
  version: 7.7.0

Hi, this is a known issue: https://github.com/elastic/cloud-on-k8s/issues/2660

Could you try to use a LimitRange as a workaround to set some default values on the init container ?

I'll investigate the complexity of this issue to see if we can change its priority.

Adding LimitRange did work. For my own reference if nothing else here the one I used

apiVersion: v1
kind: LimitRange
metadata:
  creationTimestamp: "2020-06-05T09:07:36Z"
  name: resource-limits
  namespace: test2
  resourceVersion: "2328891"
  selfLink: /api/v1/namespaces/test2/limitranges/resource-limits
  uid: a6aab5cd-6266-4303-9103-885254a305f7
spec:
  limits:
  - max:
      cpu: "5"
      memory: 5Gi
    min:
      cpu: 200m
      memory: 6Mi
    type: Pod
  - default:
      cpu: 300m
      memory: 200Mi
    defaultRequest:
      cpu: 200m
      memory: 100Mi
    max:
      cpu: "5"
      memory: 5Gi
    maxLimitRequestRatio:
      cpu: "10"
    min:
      cpu: 100m
      memory: 4Mi
    type: Container
1 Like