Vertical Pod Autoscaler (VPA)¶
The Vertical Pod Autoscaler (VPA) is a Kubernetes component that automatically recommends and applies optimal settings for a Pod's resource requests and limits (CPU and Memory).^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md]
By analyzing resource usage, VPA removes the need for developers to manually monitor and tune configurations, which can be particularly helpful for those without system optimization experience.^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md]
Functionality¶
VPA operates at the Pod level, adjusting the vertical dimension of a deployment (resource allocation) rather than the number of replicas.^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md] Its recommendations are based on historical data (history data) gathered from the Pod's past performance.^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md]
When the VPA determines that a configuration change is necessary, it updates the resources.requests and resources.limits of the Deployment.^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md]
Because updating resource requests on a running Pod is not supported, VPA applies changes by evicting (deleting) the existing Pod and recreating it with the new configuration.^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md]
Scaling Operations¶
VPA manages both scale-up (increasing resources) and scale-down (decreasing resources) operations:
- Scale-up: If Metrics indicate that usage has crossed a defined threshold, VPA increases the resource requests.^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md]
- Scale-down: Conversely, if usage drops below a threshold, VPA decreases the resource requests.^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md]
Implementation and Compatibility¶
- Custom Resource: Like the Metrics Server, VPA is implemented as a Custom Resource Definition (CRD).^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md] This means it is not always included in a default Kubernetes installation and contributes to the platform's modular nature.^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md]
- HPA Compatibility: VPA generally cannot be used simultaneously with the [[Horizontal Pod Autoscaler (HPA)|Horizontal Pod Autoscaler (HPA)]] if both are configured to manage the same resource Metrics.^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md] However, they can be used together under specific conditions, such as when HPA relies on custom metrics for triggering, or when utilizing a Multidim Pod Autoscaler (MPA).^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md]
Sources¶
^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md]
Related¶
- [[Horizontal Pod Autoscaler (HPA)|Horizontal Pod Autoscaler (HPA)]]
- Cluster Autoscaler
- [[Multidim Pod Autoscaler (MPA)|Multidim Pod Autoscaler (MPA)]]