kubegres icon indicating copy to clipboard operation
kubegres copied to clipboard

Failed to start a cluster on a namespace with quota

Open zamog opened this issue 3 years ago • 1 comments

When deploying a cluster to a namespace with resource quota enabled the 2nd pod failed to start with the error msg: create Pod database-db-2-0 in StatefulSet database-db-2- failed error: pods "database-db-2-0" is forbidden: failed quota: namespace-quota: must specify limits.memory,requests.cpu,requests.memory Can we add a minimal resource limit to the init container ?

zamog avatar Feb 22 '22 07:02 zamog

Maybe you can use default limit ranges ? Example:

apiVersion: v1
kind: LimitRange
metadata:
  name: mem-limit-range
  namespace: default
spec:
  limits:
    - default:
        memory: 4Gi
        cpu: 2
      defaultRequest:
        memory: 256Mi
        cpu: 0.1
      type: Container

bastoune avatar Apr 14 '22 13:04 bastoune