Interview's MateKubernetes
Interview's Mate

Kubernetes

K8s · Workloads · GitOps · Cloud

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Kubernetes topics
Lesson 33/ 160
02. Workload Controllers & Scaling

Vertical Pod Autoscaler (VPA) & In-Place Pod Vertical Scaling

Right-size CPU/memory with VPA and understand in-place vertical scaling trade-offs.

AdvancedVPA · Right-Sizing · In-Place3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

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 api and 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

Loading interactive 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.

Verify Right-Sizing, not only object creation

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.

Key takeaway: VPA is implemented only when this invariant remains observable: 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.

Recover from Right-Sizing drift

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.

Key takeaway: Accept the trade-off consciously: 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.

How it works, step by step

Step 1 of 4
Workload author

1. 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.

VPA contract → owned state
Key numbers at this step
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 api in 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 api first: 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

Controller-managed workload
Best for: Right-size CPU/memory with VPA and understand in-place vertical scaling trade-offs. A concrete incident check is 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.

Hand-managed Pods
Best for: Quickly testing the Right-Sizing assumption with 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.

Progressive-delivery layer
Best for: Teams that need In-Place integrated with guardrails; the evidence path is 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 api without 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?
Interview tip: Interview sequence: state the invariant, run 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

Loading quiz

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.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Custom & External Metrics Scaling with KEDA (Event-Driven Autoscaling)
Next topic
Cluster Autoscaler vs Karpenter (Dynamic Node Provisioning)