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