What are the ways to autoscale in Kubernetes (HPA, VPA, Cluster Autoscaler), and how do they fit together?
What they are really testing: Whether you distinguish scaling pods, scaling pod resources, and scaling nodes, and know they work at different layers. Confusing them leads to scaling that does not actually help.
A real interview question
What are the ways to autoscale in Kubernetes (HPA, VPA, Cluster Autoscaler), and how do they fit together?
What most people say
drag me
“You use the Horizontal Pod Autoscaler to add more pods when CPU is high.”
HPA alone is not the full picture. If the cluster has no spare capacity, more pods just go Pending, so you also need node scaling. It also misses VPA for right-sizing.
The follow-ups they ask next
You set up HPA but under load new pods stay Pending. Why?
No node capacity: HPA created replicas but the scheduler has nowhere to place them. You need the Cluster Autoscaler (or Karpenter) to add nodes. HPA scales pods, not the cluster.
Why should you avoid running HPA and VPA on the same CPU metric?
They conflict: VPA changes requests while HPA scales on utilization against those requests, so they oscillate. Use VPA for right-sizing and HPA for load, on different signals, or VPA in recommendation mode.
What the interviewer is listening for
- Distinguishes pods (HPA), pod-size (VPA), nodes (Cluster Autoscaler)
- Knows HPA pods go Pending without node scaling
- Knows HPA+VPA conflict; mentions Karpenter
What sinks the answer
- Only knows HPA
- Thinks HPA adds nodes
- Runs HPA and VPA on the same metric
If you genuinely do not know
Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.
“Three layers: [HPA scales pod replicas on CPU/memory/custom metrics], [VPA right-sizes a pod requests/limits], [Cluster Autoscaler (or Karpenter) adds/removes nodes]. They compose: [HPA adds pods, the Cluster Autoscaler adds nodes when there is no room]. Avoid [HPA and VPA on the same metric, they fight].”
Keep going with kubernetes
Foundation
What problem does Kubernetes solve, and what does it actually do for you?
Foundation
What are the main components of a Kubernetes cluster (control plane and nodes)?
Foundation
What is a Pod, and why do you use a Deployment instead of creating Pods directly?
Foundation
What is a Service in Kubernetes, and what are the main types?
Junior
When would you use a Deployment versus a StatefulSet versus a DaemonSet?
Junior
How do you inject configuration and secrets into a pod, and what is the catch with Kubernetes Secrets?
Knowing the answer is not the same as recalling it under pressure
Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.
Start free