kubegres
kubegres copied to clipboard
Failed to start a cluster on a namespace with quota
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 ?
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