Vertical Pod Autoscaler (VPA): Right-Sizing Pod Resource Requests
Fast recall
Quick revision
Core answer
requests and limits. It runs in three modes: Off (recommendations only), Initial (applies at pod creation), and Auto (evicts and recreates pods with new resources). Use VPA Recommender only for JVMs — Auto evicts pods to resize, which causes churn; HPA + VPA on the same CPU/memory dimension fight each other. Best pattern: VPA-recommend for initial right-sizing discovery, then apply recommendations manually or via GitOps; HPA for horizontal; Karpenter for nodes.Whether you understand VPA's three modes, the HPA/VPA conflict, and why Auto mode is risky for JVMs
Running VPA in Auto mode alongside HPA on CPU (they fight), or expecting VPA to resize live without restart (it cannot — resize requires pod eviction + recreation)
Explain in-place resize KEP (alpha, no eviction), recommender algorithm (percentile-based), why VPA is best as a recommendation source for capacity planning, and the interaction with LimitRange
Interview-ready guide
Interview answer
Vertical Pod Autoscaler observes actual pod resource usage over time and produces recommendations for CPU and memory requests and limits. It has three modes with very different risk profiles.
Three modes
- Off — writes recommendations to the VPA object without changing anything; this is the safest mode and what most JVM shops should use.
- Initial — applies the recommended values at pod creation but does not evict running pods.
- Auto — evicts and recreates pods when the recommendation diverges from current; churns pods to resize.
Why Off mode is usually right for JVMs
- Current VPA resizing requires pod eviction — in-place resize is an alpha/beta feature (KEP-1287) not yet generally available.
- Evicting a Spring Boot pod costs 30 to 60 seconds of cold-start latency — daily Auto-mode resizing hurts P99.
- HPA and VPA on the same CPU/memory dimension fight each other — VPA raises requests, HPA utilization percentage drops, HPA scales down; then per-pod usage rises, VPA raises requests again.
- The pragmatic pattern: HPA for horizontal scaling, VPA in Off mode for periodic right-sizing review, apply recommendations via GitOps.
The value VPA delivers even in Off mode
- Evidence-based capacity planning — after 8 days of observation, VPA tells you exactly what this workload needs at P90 CPU and peak memory.
- Removes guesswork from resource requests — teams typically overprovision by 30 to 100 percent; right-sized requests translate directly to cloud bill reduction.
- Better Karpenter bin-packing — tighter requests mean tighter node utilization; VPA + Karpenter compose well even without Auto mode.
Safe combinations with HPA
- HPA on custom metrics (RPS, queue depth) plus VPA in Auto mode on CPU/memory — no dimension conflict.
- HPA on CPU plus VPA in Off mode only — VPA recommends, you apply via GitOps.
- HPA on CPU plus VPA controlling only memory via
controlledResources: [memory]— HPA scales on CPU utilization, VPA right-sizes memory without interfering.
Gotchas to watch
- LimitRange can clip VPA recommendations — if namespace LimitRange max is below the recommendation, VPA's applied value is clipped silently.
- PDBs block Auto-mode evictions — strict PDBs mean VPA cannot resize; recommendations linger without being applied.
- Recommender window is ~8 days by default — for workloads with weekly seasonality, extend the window or stage recommendations over multiple cycles.
Vertical Pod Autoscaler (VPA): Right-Sizing Pod Resource Requests
Direct Answer
VPA observes actual pod CPU/memory usage over time and recommends or automatically applies adjusted requests and limits. It runs in three modes: Off (recommendations only), Initial (applies at pod creation), and Auto (evicts and recreates pods with new resources). Use VPA Recommender only for JVMs — Auto evicts pods to resize, which causes churn; HPA + VPA on the same CPU/memory dimension fight each other. Best pattern: VPA-recommend for initial right-sizing discovery, then apply recommendations manually or via GitOps; HPA for horizontal; Karpenter for nodes.
Common Mistakes & Pitfalls
Running VPA in Auto mode alongside HPA on CPU (they fight), or expecting VPA to resize live without restart (it cannot — resize requires pod eviction + recreation)
Check your understanding
Answer these without looking back at the article.
- Why do HPA and VPA conflict on CPU/memory and how do you safely combine them?
- What is in-place pod resize (KEP-1287) and how will it change VPA Auto mode?
- How does VPA's percentile-based recommender algorithm work?
- How do LimitRange constraints interact with VPA recommendations?
Related interview prep categories
2Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.