Resource quota
You can control vCluster resource consumption by configuring a ResourceQuota. vCluster creates the ResourceQuota in the same namespace as vCluster itself. Resource quotas apply to all resources synced to the control plane cluster.
Example
If you would normally deploy the following ResourceQuota:
apiVersion: v1
kind: ResourceQuota
metadata:
name: pods-medium
spec:
hard:
cpu: "10"
memory: 20Gi
pods: "10"
scopeSelector:
matchExpressions:
- operator : In
scopeName: PriorityClass
values: ["medium"]
Instead configure the ResourceQuota in your vcluster.yaml config file like this:
policies:
resourceQuota:
enabled: true
quota:
cpu: "10"
memory: 20Gi
pods: "10"
scopeSelector:
matchExpressions:
- operator : In
scopeName: PriorityClass
values: ["medium"]
Config reference
resourceQuota object
ResourceQuota specifies resource quota options.
resourceQuota object enabled string|boolean auto
Enabled defines if the resource quota should be enabled. "auto" means that if limitRange is enabled,
the resourceQuota will be enabled as well.
enabled string|boolean auto quota object map[count/configmaps:100 count/endpoints:40 count/persistentvolumeclaims:20 count/pods:20 count/secrets:100 count/services:20 limits.cpu:20 limits.ephemeral-storage:160Gi limits.memory:40Gi requests.cpu:10 requests.ephemeral-storage:60Gi requests.memory:20Gi requests.storage:100Gi services.loadbalancers:1 services.nodeports:0]
Quota are the quota options
quota object map[count/configmaps:100 count/endpoints:40 count/persistentvolumeclaims:20 count/pods:20 count/secrets:100 count/services:20 limits.cpu:20 limits.ephemeral-storage:160Gi limits.memory:40Gi requests.cpu:10 requests.ephemeral-storage:60Gi requests.memory:20Gi requests.storage:100Gi services.loadbalancers:1 services.nodeports:0] scopeSelector object map[matchExpressions:[]]
ScopeSelector is the resource quota scope selector
scopeSelector object map[matchExpressions:[]] scopes string[] []
Scopes are the resource quota scopes
scopes string[] [] annotations object {}
Annotations are extra annotations for this resource.
annotations object {} labels object {}
Labels are extra labels for this resource.
labels object {}