How Vertical Scaling (VPA) works
Vertical Pod Autoscaler (VPA) automates container resource management and significantly improves application efficiency. VPA is useful in scenarios where the exact resource requirements of an application are unknown in advance. When VPA is enabled and the appropriate operating mode is set, the requested resources are determined based on actual usage metrics gathered from the monitoring system. It is also possible to configure the system to only recommend resource settings without applying them automatically.
If the application load changes depending on time of day, user requests, or other factors, VPA automatically adjusts the allocated resources. This helps prevent outages due to lack of resources or excessive CPU and memory consumption.
For details on VPA operating modes, its components and limitations, refer to Architecture.
How to enable or disable VPA
You can enable VPA in the following ways:
-
Via a ModuleConfig resource (e.g., ModuleConfig/vertical-pod-autoscaler). Set the
spec.enabledparameter totrueorfalse:apiVersion: deckhouse.io/v1alpha1 kind: ModuleConfig metadata: name: vertical-pod-autoscaler spec: enabled: true -
Via the
d8command (run inside thed8-system/deckhouse pod):d8 system module enable vertical-pod-autoscaler -
Through the Deckhouse web interface:
- Go to the “Deckhouse → Modules” section;
- Find the vertical-pod-autoscaler module and click on it;
- Toggle the “Module enabled” switch.
The vertical-pod-autoscaler module has no required configuration — it can be enabled and used with default settings.
After creating a VerticalPodAutoscaler resource, you can check VPA recommendations using the following command:
d8 k describe vpa my-app-vpa
In the status section, you’ll see the following parameters:
Target: The recommended resource amount for the pod.Lower Bound: The minimum recommended resource amount for the application.Upper Bound: The maximum recommended resource amount for the application.Uncapped Target: The resource value based on extreme metrics without considering historical data.
VPA configuration
-
Create the VPA module configuration.
To configure VPA, you need to create a configuration file for the module. Example configuration:
apiVersion: deckhouse.io/v1alpha1 kind: ModuleConfig metadata: name: vertical-pod-autoscaler spec: version: 1 enabled: true settings: nodeSelector: node-role/system: "" tolerations: - key: dedicated.deckhouse.io operator: Equal value: system -
Apply the VPA configuration file using
d8 k apply -f <your-config-file-name>.
For more details on VPA resource limits configuration, see the documentation.
Module configuration example
apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
name: vertical-pod-autoscaler
spec:
version: 1
enabled: true
settings:
nodeSelector:
node-role/system: ""
tolerations:
- key: dedicated.deckhouse.io
operator: Equal
value: system