I have 3 delpoyments in my namespace. None of the deployments specify any resource limits for either CPU or memory. I am trying to set the default min and max using LimitRange for all pods and their containers(existing and future) in this namespace. I've deployed a LimitRange resource to the namespace as defined below. However, when I redeploy, the deployments fail with errors (as listed below)
LimitRange:
apiVersion: "v1"
kind: "LimitRange"
metadata:
name: "core-resource-limits"
namespace: x
spec:
limits:
- type: "Pod"
max:
cpu: 1
memory: 1Gi
min:
cpu: 2m
memory: 50Mi
- type: "Container"
max:
cpu: 1
memory: 800Mi
min:
cpu: 1m
memory: 50Mi
default:
cpu: 20m
memory: 500Mi
defaultRequest:
cpu: 10m
memory: 400Mi
maxLimitRequestRatio:
cpu: 4
I don't understand where is 2040m coming from as its not defined in the LimitRange and its not defined in any of the deployments. Similarly all the other limit values. I have tried changing all these values to a bit higher/lower but I can't figure it out. Can someone explain what is wrong with this set of values?
Thanks
Edit: All the pods are on the same node. The node limit are as follows:
- CPU requests: 2.86
- CPU limits: 48.55
- Memory requests: 7.459
- Memory limits: 28.342
