Three Ways Kubernetes Scales: HPA, VPA and Cluster Autoscaler
Kubernetes has three standard autoscalers. Each solves a different problem: how many pods, how big each pod is, and how many nodes the cluster has.
Horizontal Pod Autoscaler (HPA)
Changes the number of pods running an application or ML model. It scales on CPU and memory out of the box, and on custom metrics such as GPU utilization or requests per second through a metrics adapter. When demand spikes, HPA adds pods. When load drops, it removes them.
Vertical Pod Autoscaler (VPA)
Changes how much CPU and memory each container requests, based on what it actually uses. Right-sized requests mean you get more out of every node. VPA is an add-on you install separately, and it handles CPU and memory only.
Cluster Autoscaler (CA)
Changes the number of nodes. It adds nodes when pods can't be scheduled, and removes nodes that sit underused. That makes it essential for serving large ML models to a large user base, where demand can outgrow the cluster quickly.
Using them together
- HPA and Cluster Autoscaler pair naturally: HPA adds pods, and CA adds nodes when those pods don't fit.
- Don't let HPA and VPA both act on CPU or memory for the same workload. They'll fight each other. If you need both, drive HPA from a custom metric such as requests per second.