Vertical Pod Autoscaler (VPA) & In-Place Pod Vertical Scaling
Right-size CPU/memory with VPA and understand in-place vertical scaling trade-offs.
In plain words
VPA is tailoring each worker's uniform to observed body size while HPA opens more service windows. The simple Kubernetes rule is: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
Think of it like…
VPA is tailoring each worker's uniform to observed body size while HPA opens more service windows.
Where you’ve seen it
During a release or scale event, the workload owner runs kubectl get vpa api -o yaml; kubectl describe vpa api. Expected evidence: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits. If the run instead shows this symptom, stop and restore the last known state: A recommendation can destabilize bin-packing or an app with bursty baselines, and replacement-based updates do not provide the continuity implied by ordinary rolling scaling.
Words you’ll hear
- VPA
- For this lesson, VPA is the controlling idea: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
- Right-Sizing
- Right-Sizing is the checkpoint; run
kubectl get vpa api -o yaml; kubectl describe vpa apiand inspect the owner chain. A recommendation can destabilize bin-packing or an app with bursty baselines, and replacement-based updates do not provide the continuity implied by ordinary rolling scaling. - In-Place
- In-Place is the outcome to preserve; the cost is explicit: Vertical resizing reduces over-requesting, but it can fight HPA on CPU, requires node headroom, and makes in-place implementation maturity and container restart behavior important.
- Verification evidence
- The evidence command is
kubectl get vpa api -o yaml; kubectl describe vpa api. It connects the declaration to this behavior: Right-size CPU/memory with VPA and understand in-place vertical scaling trade-offs.
Visual diagram
Theory & deep dive
How VPA reaches the intended state
Right-size CPU/memory with VPA and understand in-place vertical scaling trade-offs. VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
The concrete checkpoint is kubectl get vpa api -o yaml; kubectl describe vpa api; compare the VPA owner, Right-Sizing state, and In-Place outcome instead of treating YAML acceptance as proof.
Run kubectl get vpa api -o yaml; kubectl describe vpa api after the change and correlate the result with Events and the owning object. VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
Right-Sizing: failure boundary and production cost
A recommendation can destabilize bin-packing or an app with bursty baselines, and replacement-based updates do not provide the continuity implied by ordinary rolling scaling. The prerequisite contract is concrete: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
Vertical resizing reduces over-requesting, but it can fight HPA on CPU, requires node headroom, and makes in-place implementation maturity and container restart behavior important. A safe design limits blast radius, records the last good configuration, and uses kubectl get vpa api -o yaml; kubectl describe vpa api as a deterministic rollback checkpoint.
Capture the current state with kubectl get vpa api -o yaml; kubectl describe vpa api, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: A recommendation can destabilize bin-packing or an app with bursty baselines, and replacement-based updates do not provide the continuity implied by ordinary rolling scaling.
How it works, step by step
Step 1 of 41. Declare workload intent
Write the controller-owned Pod or scaling intent and preserve the owner chain: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
- Goal
- Right-size CPU/memory with VPA and understand in-place vertical scaling trade-offs.
- Owner
- VPA
When to use it & trade-offs
What it is
Right-size CPU/memory with VPA and understand in-place vertical scaling trade-offs. VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
Why it matters: A recommendation can destabilize bin-packing or an app with bursty baselines, and replacement-based updates do not provide the continuity implied by ordinary rolling scaling. The invariant at risk is specific: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits. The quickest fact check before changing the design is kubectl get vpa api -o yaml; kubectl describe vpa api.
When to reach for it
- Use VPA to enforce this invariant: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
- Use Right-Sizing evidence from
kubectl get vpa api -o yaml; kubectl describe vpa apiin reviews and incident timelines. Right-size CPU/memory with VPA and understand in-place vertical scaling trade-offs. - Choose the progressive-delivery layer route only when this cost is justified by governance or scale: Vertical resizing reduces over-requesting, but it can fight HPA on CPU, requires node headroom, and makes in-place implementation maturity and container restart behavior important.
When to avoid or be careful
- Avoid assuming VPA is complete after YAML submission; the required behavior is concrete: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
- Avoid treating the next symptom as random; check the owner and state with
kubectl get vpa api -o yaml; kubectl describe vpa apifirst: A recommendation can destabilize bin-packing or an app with bursty baselines, and replacement-based updates do not provide the continuity implied by ordinary rolling scaling. - Avoid adopting a heavier platform wrapper before measuring its cost: Vertical resizing reduces over-requesting, but it can fight HPA on CPU, requires node headroom, and makes in-place implementation maturity and container restart behavior important.
Native, manual, and managed paths for VPA
kubectl get vpa api -o yaml; kubectl describe vpa api.Strengths: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
Watch out: Vertical resizing reduces over-requesting, but it can fight HPA on CPU, requires node headroom, and makes in-place implementation maturity and container restart behavior important. Recovery must also recognize this signal: A recommendation can destabilize bin-packing or an app with bursty baselines, and replacement-based updates do not provide the continuity implied by ordinary rolling scaling.
kubectl get vpa api -o yaml; kubectl describe vpa api; the expected invariant is: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.Strengths: kubectl get vpa api -o yaml; kubectl describe vpa api gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike VPA, it does not make this symptom self-documenting: A recommendation can destabilize bin-packing or an app with bursty baselines, and replacement-based updates do not provide the continuity implied by ordinary rolling scaling.
kubectl get vpa api -o yaml; kubectl describe vpa api.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
Watch out: The added platform ownership buys value at this cost: Vertical resizing reduces over-requesting, but it can fight HPA on CPU, requires node headroom, and makes in-place implementation maturity and container restart behavior important.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
- Trace VPA to In-Place through Right-Sizing; the invariant is: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
- Recognize the symptom: A recommendation can destabilize bin-packing or an app with bursty baselines, and replacement-based updates do not provide the continuity implied by ordinary rolling scaling.
- Justify the cost: Vertical resizing reduces over-requesting, but it can fight HPA on CPU, requires node headroom, and makes in-place implementation maturity and container restart behavior important.
- Verify with kubectl get vpa api -o yaml; kubectl describe vpa api instead of only inspecting YAML.
Benchmarks & rules of thumb
- 3
- VPA components commonly discussed: recommender, updater, and admission controller
- 1
- resource recommendation cannot fix an application memory leak
- 0
- recommended value is not automatically safe under every mode
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the VPA owner contract: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits.
- Ignoring this telltale condition leads to unrelated changes: A recommendation can destabilize bin-packing or an app with bursty baselines, and replacement-based updates do not provide the continuity implied by ordinary rolling scaling.
- Repeating
kubectl get vpa api -o yaml; kubectl describe vpa apiwithout an owner for remediation wastes retry cost. Vertical resizing reduces over-requesting, but it can fight HPA on CPU, requires node headroom, and makes in-place implementation maturity and container restart behavior important.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits?
- Which owner object, logs, and Events would you inspect for this symptom-A recommendation can destabilize bin-packing or an app with bursty baselines, and replacement-based updates do not provide the continuity implied by ordinary rolling scaling-?
- At what threshold would this cost become unacceptable: Vertical resizing reduces over-requesting, but it can fight HPA on CPU, requires node headroom, and makes in-place implementation maturity and container restart behavior important?
kubectl get vpa api -o yaml; kubectl describe vpa api, name the failure, then justify the cost. Invariant: VPA recommends CPU and memory requests by observing usage, and admission or update components can apply recommendations when workload policy permits. Failure: A recommendation can destabilize bin-packing or an app with bursty baselines, and replacement-based updates do not provide the continuity implied by ordinary rolling scaling. Cost: Vertical resizing reduces over-requesting, but it can fight HPA on CPU, requires node headroom, and makes in-place implementation maturity and container restart behavior important.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Vertical Pod Autoscaler (VPA) & In-Place Pod Vertical Scaling with generative AI interview Q&A and hands-on practice.