Limit range
You can create a LimitRange policy to constrain tenant cluster resource allocation. vCluster creates the LimitRange on the host in the same namespace as vCluster itself. LimitRange only applies to synced resources, such as pods.
Example​
If you would normally deploy the following LimitRange:
apiVersion: v1
kind: LimitRange
metadata:
name: vcluster-limit-range
spec:
limits:
- default:
memory: 512Mi
cpu: "1"
defaultRequest:
memory: 128Mi
cpu: 100m
type: Container
Instead configure the LimitRange in your vcluster.yaml config file like this:
policies:
limitRange:
enabled: true
default:
memory: 512Mi
cpu: "1"
defaultRequest:
memory: 128Mi
cpu: 100m
Config reference​
limitRange object ​
LimitRange specifies limit range options.
limitRange object ​enabled string|boolean auto ​
Enabled defines if the limit range should be deployed by vCluster. "auto" means that if resourceQuota is enabled,
the limitRange will be enabled as well.
enabled string|boolean auto ​default object map[cpu:1 ephemeral-storage:8Gi memory:512Mi] ​
Default are the default limits for the limit range
default object map[cpu:1 ephemeral-storage:8Gi memory:512Mi] ​defaultRequest object map[cpu:100m ephemeral-storage:3Gi memory:128Mi] ​
DefaultRequest are the default request options for the limit range
defaultRequest object map[cpu:100m ephemeral-storage:3Gi memory:128Mi] ​max object {} ​
Max are the max limits for the limit range
max object {} ​min object {} ​
Min are the min limits for the limit range
min object {} ​annotations object {} ​
Annotations are extra annotations for this resource.
annotations object {} ​labels object {} ​
Labels are extra labels for this resource.
labels object {} ​