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 host 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
required object ​
ResourceQuota specifies resource quota options.
resourceQuota
required object ​enabled
required 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
required string|boolean auto ​quota
required 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
required 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
required object map[matchExpressions:[]] ​
ScopeSelector is the resource quota scope selector
scopeSelector
required object map[matchExpressions:[]] ​scopes
required string[] [] ​
Scopes are the resource quota scopes
scopes
required string[] [] ​annotations
required object {} ​
Annotations are extra annotations for this resource.
annotations
required object {} ​labels
required object {} ​
Labels are extra labels for this resource.
labels
required object {} ​