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 23/ 160
02. Workload Controllers & Scaling

Rolling Updates, maxSurge & maxUnavailable Strategies

Tune rolling update surge and unavailability so releases stay fast and safe.

IntermediateRolling Update · maxSurge · maxUnavailable3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

Rolling updates are a ferry dock with extra boarding space: surge buys speed, while unavailable indicates how many berths may be empty. The simple Kubernetes rule is: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.

Think of it like…

Rolling updates are a ferry dock with extra boarding space: surge buys speed, while unavailable indicates how many berths may be empty.

Where you’ve seen it

During a release or scale event, the workload owner runs kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m. Expected evidence: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules. If the run instead shows this symptom, stop and restore the last known state: With both values at zero, a rolling Deployment has no legal path to progress; strict PDBs can also leave the old ReplicaSet holding Pods.

Words you’ll hear

Rolling Update
For this lesson, Rolling Update is the controlling idea: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.
maxSurge
maxSurge is the checkpoint; run kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m and inspect the owner chain. With both values at zero, a rolling Deployment has no legal path to progress; strict PDBs can also leave the old ReplicaSet holding Pods.
maxUnavailable
maxUnavailable is the outcome to preserve; the cost is explicit: A large surge shortens rollout but doubles capacity and external dependencies, whereas a high unavailable value saves resources by exposing more service risk.
Verification evidence
The evidence command is kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m. It connects the declaration to this behavior: Tune rolling update surge and unavailability so releases stay fast and safe.

Visual diagram

Loading interactive diagram

Theory & deep dive

How Rolling Update reaches the intended state

Tune rolling update surge and unavailability so releases stay fast and safe. MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.

The concrete checkpoint is kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m; compare the Rolling Update owner, maxSurge state, and maxUnavailable outcome instead of treating YAML acceptance as proof.

Verify maxSurge, not only object creation

Run kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m after the change and correlate the result with Events and the owning object. MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.

Key takeaway: Rolling Update is implemented only when this invariant remains observable: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.

maxSurge: failure boundary and production cost

With both values at zero, a rolling Deployment has no legal path to progress; strict PDBs can also leave the old ReplicaSet holding Pods. The prerequisite contract is concrete: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.

A large surge shortens rollout but doubles capacity and external dependencies, whereas a high unavailable value saves resources by exposing more service risk. A safe design limits blast radius, records the last good configuration, and uses kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m as a deterministic rollback checkpoint.

Recover from maxSurge drift

Capture the current state with kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: With both values at zero, a rolling Deployment has no legal path to progress; strict PDBs can also leave the old ReplicaSet holding Pods.

Key takeaway: Accept the trade-off consciously: A large surge shortens rollout but doubles capacity and external dependencies, whereas a high unavailable value saves resources by exposing more service risk.

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: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.

Rolling Update contract → owned state
Key numbers at this step
Goal
Tune rolling update surge and unavailability so releases stay fast and safe.
Owner
Rolling Update

When to use it & trade-offs

What it is

Tune rolling update surge and unavailability so releases stay fast and safe. MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.

Why it matters: With both values at zero, a rolling Deployment has no legal path to progress; strict PDBs can also leave the old ReplicaSet holding Pods. The invariant at risk is specific: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules. The quickest fact check before changing the design is kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m.

When to reach for it

  • Use Rolling Update to enforce this invariant: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.
  • Use maxSurge evidence from kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m in reviews and incident timelines. Tune rolling update surge and unavailability so releases stay fast and safe.
  • Choose the progressive-delivery layer route only when this cost is justified by governance or scale: A large surge shortens rollout but doubles capacity and external dependencies, whereas a high unavailable value saves resources by exposing more service risk.

When to avoid or be careful

  • Avoid assuming Rolling Update is complete after YAML submission; the required behavior is concrete: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.
  • Avoid treating the next symptom as random; check the owner and state with kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m first: With both values at zero, a rolling Deployment has no legal path to progress; strict PDBs can also leave the old ReplicaSet holding Pods.
  • Avoid adopting a heavier platform wrapper before measuring its cost: A large surge shortens rollout but doubles capacity and external dependencies, whereas a high unavailable value saves resources by exposing more service risk.

Native, manual, and managed paths for Rolling Update

Controller-managed workload
Best for: Tune rolling update surge and unavailability so releases stay fast and safe. A concrete incident check is kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m.

Strengths: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.

Watch out: A large surge shortens rollout but doubles capacity and external dependencies, whereas a high unavailable value saves resources by exposing more service risk. Recovery must also recognize this signal: With both values at zero, a rolling Deployment has no legal path to progress; strict PDBs can also leave the old ReplicaSet holding Pods.

Hand-managed Pods
Best for: Quickly testing the maxSurge assumption with kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m; the expected invariant is: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.

Strengths: kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m gives immediate feedback without first building a platform layer.

Watch out: A manual change can hide drift, and unlike Rolling Update, it does not make this symptom self-documenting: With both values at zero, a rolling Deployment has no legal path to progress; strict PDBs can also leave the old ReplicaSet holding Pods.

Progressive-delivery layer
Best for: Teams that need maxUnavailable integrated with guardrails; the evidence path is kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m.

Strengths: Platform controls can wrap this exact behavior in policy or dashboards: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.

Watch out: The added platform ownership buys value at this cost: A large surge shortens rollout but doubles capacity and external dependencies, whereas a high unavailable value saves resources by exposing more service risk.

Interview signals & numbers to know

When this topic comes up

  • Interview anchor: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.
  • Trace Rolling Update to maxUnavailable through maxSurge; the invariant is: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.
  • Recognize the symptom: With both values at zero, a rolling Deployment has no legal path to progress; strict PDBs can also leave the old ReplicaSet holding Pods.
  • Justify the cost: A large surge shortens rollout but doubles capacity and external dependencies, whereas a high unavailable value saves resources by exposing more service risk.
  • Verify with kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m instead of only inspecting YAML.

Benchmarks & rules of thumb

25% -
default maxSurge for Deployments
25% -
default maxUnavailable for Deployments
0 -
cannot be the effective maxSurge and maxUnavailable together

Common mistakes & follow-ups

Common interview mistakes

  • Debugging only the child object misses the Rolling Update owner contract: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules.
  • Ignoring this telltale condition leads to unrelated changes: With both values at zero, a rolling Deployment has no legal path to progress; strict PDBs can also leave the old ReplicaSet holding Pods.
  • Repeating kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m without an owner for remediation wastes retry cost. A large surge shortens rollout but doubles capacity and external dependencies, whereas a high unavailable value saves resources by exposing more service risk.

Likely interviewer follow-ups

  • How would API output and runtime evidence prove this behavior: maxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules?
  • Which owner object, logs, and Events would you inspect for this symptom-With both values at zero, a rolling Deployment has no legal path to progress; strict PDBs can also leave the old ReplicaSet holding Pods-?
  • At what threshold would this cost become unacceptable: A large surge shortens rollout but doubles capacity and external dependencies, whereas a high unavailable value saves resources by exposing more service risk?
Interview tip: Interview sequence: state the invariant, run kubectl set image deploy/api api=api:2026.11; kubectl rollout status deploy/api --timeout=5m, name the failure, then justify the cost. Invariant: MaxSurge permits temporary Pods above desired during an update, maxUnavailable permits fewer available old/new Pods, and percentages round according to controller rules. Failure: With both values at zero, a rolling Deployment has no legal path to progress; strict PDBs can also leave the old ReplicaSet holding Pods. Cost: A large surge shortens rollout but doubles capacity and external dependencies, whereas a high unavailable value saves resources by exposing more service risk.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Rolling Updates, maxSurge & maxUnavailable Strategies with generative AI interview Q&A and hands-on practice.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Deployments: Managing Stateless Applications
Next topic
Deployment Rollbacks, Revision History & Pausing Rollouts