v1 · Cluster Resource
LimitRange
LimitRange sets resource usage limits for each kind of resource in a Namespace.
Click on Property Name to see the description, and Pink Types to expand schema.
Looking for some examples?
There are 2 examples of LimitRange that you can use as a starting point to create your own.
apiVersion: v1 kind: LimitRange metadata: name: defaults-cpu-memory namespace: payments # only pods in the payments namespace will be affected spec: limits: - defaultRequest: # pods without a CPU or Memory request defined in their spec will get this value cpu: 500m memory: 512Mi type: Container
apiVersion: v1
kind: LimitRange
metadata:
name: minmax-cpu-memory
namespace: payments # only pods in the payments namespace will be affected
spec:
limits:
- max: # pods in this namespace can't have limits higher than 1 CPU and 2Gi Memory
cpu: '1'
memory: 2Gi
min: # pods in this namespace must have limits higher than 100m CPU and 512Mi Memory
cpu: 100m
memory: 512Mi
default: # in case a pod doesn't specify a CPU or Memory limit, it will get this value
cpu: 500m
memory: 1Gi
type: Container