A set of components that automatically adjust the amount of CPU and memory requested by pods running in the Kubernetes cluster
open sourceApache-2.0self-hostablefree
Vertical Pod Autoscaler (VPA) sets the CPU and memory requests of Kubernetes containers from their actual usage, scaling down pods that over-request and up pods that under-request, while keeping the ratio between requests and limits. A VerticalPodAutoscaler resource picks the workload and the update mode: Off (recommendations only), Initial (at pod creation), Recreate (evicting pods to apply them), InPlaceOrRecreate, or InPlace, which never evicts. Its recommender computes recommendations from usage history, the updater evicts or resizes pods, and a mutating admission webhook sets requests on new pods. It's part of the kubernetes/autoscaler repository with Cluster Autoscaler, maintained by Kubernetes SIG Autoscaling under Apache-2.0.
Ways to install
On Kubernetes
Problems it solves
- I have no idea what CPU and memory requests to set for my containers
- pods keep getting OOMKilled because their memory requests are too low
- we're paying for nodes full of pods that reserve far more CPU than they use
- get right-sizing recommendations for container resource requests without changing anything
- adjust a running pod's resources without restarting it
- set resource requests automatically on new pods from their usage history
- keep the limit-to-request ratio when requests are raised automatically
- cap automatic resource recommendations so pods don't become too big to schedule
- give slow-starting apps extra CPU while they start up, then drop back to normal requests
Features
- VerticalPodAutoscaler custom resource
- update modes Off, Initial, Recreate, InPlaceOrRecreate and InPlace (Auto deprecated)
- recommender, updater and admission controller components
- in-place resource updates (InPlaceOrRecreate GA in VPA 1.6)
- respects PodDisruptionBudgets through the Eviction API
- keeps limit-to-request ratios; per-container policies and min and max bounds
- usage history from VerticalPodAutoscalerCheckpoint or Prometheus
- CPU and memory recommendation rounding
- CPU startup boost
- install script (vpa-up.sh) and a Helm chart
Limitations
- Shouldn't be used with the Horizontal Pod Autoscaler on the same CPU or memory metric: HPA on other or custom metrics is fine2
- Doesn't support pods with pod-level resources stanzas: the admission controller can block those pods from being created3
- Doesn't update pods that aren't run under a controller2
