The module lifecycle stage: Experimental
The module has requirements for installation
Enabling AutoVPA for all namespaces
To enable the AutoVPA controller for all namespaces in the cluster, set settings.autovpa.enabled to true without specifying additional filters:
apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
name: adaptive-resource-management
spec:
version: 1
enabled: true
settings:
autovpa:
enabled: trueIn this mode, AutoVPA creates VPA objects for workloads in every namespace.
Enabling AutoVPA for specific namespaces using a label selector
To limit AutoVPA to namespaces matching a label selector, use the namespaceLabelSelector parameter:
apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
name: adaptive-resource-management
spec:
version: 1
enabled: true
settings:
autovpa:
enabled: true
namespaceLabelSelector:
matchLabels:
env: prodAutoVPA will only manage namespaces that have the env: prod label.
Enabling AutoVPA for namespaces with a special label
To manage only namespaces explicitly marked with the autovpa.deckhouse.io/enabled: "true" label, use the onlySpecialLabel parameter:
apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
name: adaptive-resource-management
spec:
version: 1
enabled: true
settings:
autovpa:
enabled: true
onlySpecialLabel: trueThen add the label to the desired namespaces:
d8 k label namespace my-namespace autovpa.deckhouse.io/enabled=trueCombining a label selector with the special label
When both onlySpecialLabel and namespaceLabelSelector are set, the resulting list of managed namespaces is the union of both sets:
apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
name: adaptive-resource-management
spec:
version: 1
enabled: true
settings:
autovpa:
enabled: true
onlySpecialLabel: true
namespaceLabelSelector:
matchLabels:
team: backendIn this example, AutoVPA will manage namespaces that either have the team: backend label or the autovpa.deckhouse.io/enabled: "true" label (or both).
Namespace selection behavior summary
onlySpecialLabel |
namespaceLabelSelector |
Managed namespaces |
|---|---|---|
false |
not set | All namespaces |
false |
set | Only namespaces matching the selector |
true |
not set | Only namespaces with the autovpa.deckhouse.io/enabled: "true" label |
true |
set | Union: namespaces matching the selector + namespaces with the special label |