Compare the Horizontal Pod Autoscaler, Vertical Pod Autoscaler, and Cluster Autoscaler.
Quick Answer
HPA adds/removes pod replicas based on metrics; VPA right-sizes a pod's CPU/memory requests; Cluster Autoscaler adds/removes nodes when pods can't be scheduled or nodes are underused. They operate at different layers and are often combined.
Detailed Answer
HPA scales out: it watches a metric (CPU utilization, memory, or custom/external metrics) and changes the replica count of a Deployment to hit a target. VPA scales up/down within a pod: it observes actual usage and adjusts CPU/memory requests, either recommending or auto-applying (which recreates pods). Cluster Autoscaler scales the node pool: when pods are Pending because no node has room, it adds nodes; when nodes sit underutilized and their pods can move, it removes them. They compose: HPA + Cluster Autoscaler is the classic pair (more pods → more nodes). HPA and VPA on the same resource metric conflict (both reacting to CPU), so you generally don't run them on the same signal. On managed clusters, Karpenter is a popular, faster alternative to Cluster Autoscaler that provisions right-sized nodes just-in-time.
Code Example
# HPA: replicas by CPU kubectl autoscale deploy web --cpu-percent=60 --min=3 --max=30 # Cluster Autoscaler / Karpenter then adds nodes when pods go Pending kubectl get pods --field-selector=status.phase=Pending # the scale-up trigger
Interview Tip
Three layers: HPA=more pods, VPA=bigger pods, Cluster Autoscaler=more nodes. Warn that HPA+VPA on the same metric fight each other, and name Karpenter as the modern node-scaler.