Kubernetes Interview Questions on Rolling Updates
Reviewed by Mark Dickie · Last updated
6 questions on this page you can answer and see marked on the spot. Go to the first one
Kubernetes rolling updates are the default deployment strategy that gradually replaces old pods with new ones, keeping a portion of your application available throughout the rollout. Interviewers focus on the two parameters that control the pace: maxSurge adds extra pods above the desired count during the update, and maxUnavailable sets how many pods can be down at once. You should know how to inspect rollout progress with kubectl rollout status and revert a bad release with kubectl rollout undo. Most candidates stumble when asked what happens if readiness probes fail mid-update or how revisionHistoryLimit affects rollback.
What do maxSurge and maxUnavailable control in a rolling update?
These two fields live under spec.strategy.rollingUpdate and together they set the speed and safety margin of the update. Both accept either an integer or a percentage of the desired replica count.
| Parameter | Default | What it controls |
|---|---|---|
maxSurge | 25% | Extra pods allowed above the desired replica count |
maxUnavailable | 25% | Pods that can be unavailable during the update |
Setting maxSurge: 0 with maxUnavailable: 1 forces a one-at-a-time replacement with no temporary overcapacity. Setting maxUnavailable: 0 with maxSurge: 1 means new pods must be ready before any old pod is removed.
How do you monitor and control a rollout?
- Check status with
kubectl rollout status deployment/<name>. It blocks until the rollout finishes or the watch times out. - View revision history with
kubectl rollout history deployment/<name>to see prior ReplicaSets. - Roll back to a previous revision using
kubectl rollout undo deployment/<name>, or target a specific revision with--to-revision=N. - Pause an in-progress rollout with
kubectl rollout pausewhen you need to batch multiple changes. - Resume with
kubectl rollout resumewhen you are ready to continue.
Key facts
- Tarmac's Kubernetes interview questions cover 18 questions at difficulty 1–5 of 5.
- Tarmac tracked 2,661 job postings asking for Kubernetes in September 2026.
- Roles asking for Kubernetes advertise a median base salary of £80,000, across 807 job postings as of September 2026.
- Tarmac last reviewed these Kubernetes interview questions on 13 October 2026.
At a glance
| Questions | 18 |
|---|---|
| Difficulty | 1–5 of 5 |
| Formats | Multiple choice, Fill in the blank, Short answer, True / false, Ordering, Flashcard |
What you'll review
- rolling updates
Practice questions
Try one before you open the answer. Pick an option and press Check; it's marked on the spot.
When you update the container image in a Kubernetes Deployment without specifying a strategy, which rollout strategy is used by default?#
Options
Show answer
The default rollout strategy for a Kubernetes Deployment is RollingUpdate. It replaces old Pods with new ones gradually, so the application stays available during the update. Recreate must be set explicitly in spec.strategy.type if you want all old Pods stopped before new ones start.
A Kubernetes Deployment defaults to the RollingUpdate strategy unless you explicitly set spec.strategy.type to Recreate. RollingUpdate gradually replaces old Pods with new ones, keeping the application available during the update. Recreate, the only other built-in strategy type, terminates all old Pods before creating new ones, causing downtime. Blue-green and canary are release patterns that are not built-in Deployment strategy types.
By default, a rolling update allows at most _____ of the Deployment's Pods to be unavailable at any time during the rollout. (Express your answer as a percentage without the % sign.)#
Show answer
By default, a rolling update allows at most 25 of the Deployment's Pods to be unavailable at any time during the rollout. (Express your answer as a percentage without the % sign.)
The default value of maxUnavailable for a Deployment's RollingUpdate strategy is 25%, so up to a quarter of the desired replica count can be unavailable while the rollout proceeds. The field accepts either a percentage string or an absolute integer, and the percentage form is the default.
Which kubectl command reverts a Deployment named web-app back to its previous rollout revision?#
Show answer
kubectl rollout undo deployment/web-app
kubectl rollout undo deployment/web-app reverts the Deployment to its immediately previous revision, which is the rollback behavior the question asks for. The rollout undo subcommand works on the Deployment's stored ReplicaSet revision history. You can also target a specific revision with the --to-revision flag.
True or false: in Kubernetes, the default deployment strategy for a Deployment is RollingUpdate.#
Options
Show answer
True, the default deployment strategy in Kubernetes is RollingUpdate. If a Deployment does not set .spec.strategy.type, Kubernetes applies RollingUpdate with maxSurge and maxUnavailable both at 25%, replacing pods gradually rather than all at once.
When you create a Deployment and do not explicitly set .spec.strategy.type, Kubernetes defaults it to RollingUpdate with maxSurge and maxUnavailable both set to 25%. The statement is therefore true.
During a rolling update of a Kubernetes Deployment, what do the maxSurge and maxUnavailable fields control?#
Show answer
maxSurge controls the maximum number (or percentage) of extra pods that can be created above the desired replica count during the update, while maxUnavailable controls the maximum number (or percentage) of pods that can be unavailable below the desired count at any point during the update.
maxSurge is the maximum number of pods the controller may create above the desired replica count to speed up the rollout, while maxUnavailable is the maximum number of pods that may be unavailable below the desired count at the same time. Together they bound how aggressively the rollout proceeds: a higher surge adds capacity during the update, and a higher unavailable count removes capacity faster.
A Kubernetes Deployment is configured with 4 replicas, strategy: RollingUpdate, maxSurge: 1, and maxUnavailable: 1. What is the maximum total number of pods that can exist at the same time during the rolling update? Explain how each of the two settings affects that number.#
Show answer
The maximum is 5. maxSurge sets how many pods can be created above the desired replica count, so the ceiling is 4 + 1 = 5. maxUnavailable only limits how many old pods can be taken down at once; it does not raise the total pod ceiling above desired replicas plus maxSurge.
The total pod count during a RollingUpdate is bounded by desired replicas plus maxSurge. With 4 replicas and maxSurge=1, the controller can run at most 4 + 1 = 5 pods at once. maxUnavailable=1 governs how many old pods can be removed before new ones are ready, which affects the minimum available count, not the upper bound on total pods, so it does not change the maximum of 5.
By default, the Kubernetes Deployment RollingUpdate strategy sets maxSurge to _____% and maxUnavailable to _____% of the desired number of replicas.#
Show answer
By default, the Kubernetes Deployment RollingUpdate strategy sets maxSurge to 25% and maxUnavailable to 25% of the desired number of replicas.
Both RollingUpdate defaults are 25% of the desired replica count, so maxSurge is 25% and maxUnavailable is 25%. When these percentages are converted to pod counts, Kubernetes rounds maxSurge up and rounds maxUnavailable down, so for a 4-replica Deployment maxSurge allows 1 extra pod and maxUnavailable allows 1 pod to be unavailable.
Consider a Kubernetes Deployment with maxUnavailable: 0 and maxSurge set to at least 1. Considering only the actions the rollout itself takes (ignoring node failures, crashes, or evictions), the Deployment controller never reduces the number of Ready pods below the desired replica count at any point during the rolling update. True or false?#
Options
Show answer
True. With maxUnavailable: 0 and maxSurge of at least 1, a Deployment's rolling update never drops Ready pods below the desired replica count. The controller starts a new pod, waits for it to pass its readiness check, and only then terminates an old one. External failures such as node crashes are outside this guarantee.
With maxUnavailable: 0, the rolling update may not take any pod below the desired count. The controller therefore creates surge pods first and waits until each new pod passes its readiness probe (and minReadySeconds, if set) before it scales down an old pod. The Ready count stays at or above the desired replicas throughout the rollout. The statement is scoped to the rollout's own actions because external events such as node failures or crashes can still reduce available pods. maxSurge must be at least 1 here, since the API rejects a Deployment where both maxUnavailable and maxSurge are 0.
In Kubernetes, when you perform a rolling update on a Deployment without specifying any strategy.rollingUpdate parameters, what are the default values of maxSurge and maxUnavailable?#
Show answer
maxSurge defaults to 25% and maxUnavailable defaults to 25%. Both are percentages of the desired replica count, so the update can temporarily run up to 25% extra pods while letting up to 25% of the desired pods be unavailable.
Kubernetes Deployments default to the RollingUpdate strategy, and when no rollingUpdate parameters are set, maxSurge and maxUnavailable both default to 25%. maxSurge is the number of pods allowed above the desired replica count during the update, and maxUnavailable is the number of pods allowed to be unavailable below that count. Percentages are resolved against the desired replicas: maxSurge rounds up and maxUnavailable rounds down, so the update proceeds gradually while most capacity stays available.
Explain how a Deployment achieves a zero-downtime rolling update, and the role readiness probes play in it.#
Show answer
On a template change, the Deployment creates a new ReplicaSet and shifts replicas gradually: it scales the new ReplicaSet up and the old one down a few Pods at a time, bounded by maxSurge (extra Pods allowed above desired) and maxUnavailable (how many can be missing). A new Pod only counts as available — and the old one is only removed — once it passes its readiness probe, so traffic is shifted to Pods that can actually serve. If the readiness probe is missing or wrong, Kubernetes routes traffic to not-yet-ready Pods and you get errors during the rollout, defeating the zero-downtime goal.
Zero-downtime comes from overlapping old and new Pods and only retiring an old Pod after a new one is ready. maxSurge/maxUnavailable control how aggressive the swap is, and the readiness probe is the gate that decides 'ready to receive traffic.' Skipping the readiness probe is the usual reason a 'rolling' update still drops requests.
In a Kubernetes Deployment rolling update, what mechanism prevents a newly created Pod from receiving client traffic until it is ready, and what must the Pod pass before the Service routes traffic to it?#
Show answer
A readiness probe configured on the container spec prevents traffic from reaching a Pod before it is ready. The Pod must pass its readiness probe before the endpoints controller (EndpointSlice controller for the Service) adds the Pod's IP to the Service's endpoints, so traffic is only routed to Pods that report themselves ready.
The readiness probe is the mechanism that gates traffic to new Pods during a rolling update. The control plane's endpoints machinery (the Endpoints and EndpointSlice controllers) adds a Pod's IP to the Service's endpoints only after the Pod's readiness probe succeeds, so a Pod that is still initializing does not receive client traffic. Without a readiness probe, a container is treated as ready as soon as it starts, which is why the probe is what makes the gating meaningful.
During a default rolling update of a Deployment, order the steps the controller repeats to swap one Pod from the old version to the new.#
Put these in order
Show answer
- Create (or reuse) a ReplicaSet for the new Pod template
- Scale the new ReplicaSet up by one, within the maxSurge budget
- Wait for the new Pod to pass its readiness probe and become available
- Scale the old ReplicaSet down by one
- Repeat until the new ReplicaSet is at full replicas and the old is at zero
A rolling update overlaps old and new: bring up a new Pod, wait until it's ready (the readiness probe is the gate), only then retire an old one — keeping enough Pods serving throughout, bounded by maxSurge and maxUnavailable. Retiring the old Pod before the new one is ready is exactly the mistake that turns a 'zero-downtime' rollout into dropped requests. The cycle continues until the new ReplicaSet fully replaces the old.
A Deployment manifest with 4 replicas sets strategy.type: RollingUpdate with maxSurge: 0 and maxUnavailable: 0. You run kubectl apply -f on this manifest against a cluster running a current Kubernetes release. What does the API server do with it, and why? Explain the rule that causes this.#
Show answer
The API server rejects the manifest with a validation error (similar to "may not be 0 when maxSurge is 0"), so the Deployment is not created or updated and no rollout starts. A rolling update must either create a new pod before removing an old one (which needs maxSurge greater than 0) or remove an old pod before creating a new one (which needs maxUnavailable greater than 0). Kubernetes validation requires at least one of these two values to be non-zero, so setting both to 0 is invalid.
The rollout never begins because the API server validates RollingUpdate parameters on create and update and refuses a Deployment where both maxSurge and maxUnavailable are 0. Without surge capacity a new pod cannot be created ahead of an old one, and without unavailability allowance an old pod cannot be removed first, so there is no legal update path. The result is a rejected apply, not a stuck rollout, which is a common misconception from reasoning about the two fields in isolation.
A dynamic array starts with capacity 1 and doubles its capacity whenever it becomes full. What is the amortized time complexity of a single append (push-back) operation, and how does the doubling strategy ensure this bound? Briefly justify your answer using the accounting method or potential method.#
Show answer
The amortized cost per append is Θ(1). When the array grows from capacity c to 2c, the copy cost is c, but c cheap insertions have elapsed since the previous resize. By the accounting method, charging a constant amount per insertion (e.g., 3 coins: one for the write, two saved for the future copy) fully pays for every doubling. Over n appends the total work is O(n), so each individual append is O(1) amortized.
The amortized cost per append is O(1). When the array doubles from capacity c to 2c, the resize copies c elements, but exactly c cheap insertions have occurred since the last resize. Using the accounting method, charging 3 coins per insertion (1 for the write, 2 saved toward the next copy) covers every resizing cost. Summing over n appends gives O(n) total work, so each append is O(1) amortized. The key insight is that expensive resizes become exponentially rarer as the array grows, so they are dominated by the cheap inserts between them.
A Kubernetes Deployment rolling update enforces that the number of unavailable pods never exceeds maxUnavailable. What precise definition of 'available' does Kubernetes use when computing this constraint, and how does the minReadySeconds field influence the speed of a rolling update?#
Show answer
A pod counts as available only after it has been in the Ready condition (readiness probe passing) continuously for at least minReadySeconds seconds. The maxUnavailable budget counts pods that are not available, so a new pod that is Ready but has not yet met minReadySeconds still consumes that budget. The controller cannot remove more old pods until enough new pods become Available, so a non-zero minReadySeconds slows the rollout by forcing it to wait that duration before each further step.
Kubernetes separates 'Ready' (the readiness probe passes) from 'Available' (Ready for at least minReadySeconds). The maxUnavailable constraint is enforced against Available pods, not merely Ready ones. A new pod that passes its readiness probe but has not yet been Ready for minReadySeconds is still counted as unavailable, so the controller must wait before removing more old pods. This slows the rollout whenever minReadySeconds is non-zero.
A Kubernetes Deployment with replicas=8 uses a RollingUpdate strategy with maxUnavailable=3 and maxSurge=2. A PodDisruptionBudget with minAvailable=6 selects the same pod labels. There is no node maintenance; the rollout is triggered only by a container image change. Which statement accurately describes what happens?#
Options
Show answer
A Deployment's rolling update is governed by its own maxUnavailable and maxSurge settings, not by a PodDisruptionBudget. The Deployment controller scales ReplicaSets directly and never calls the Eviction API, so a PDB with minAvailable=6 does not limit or block the rollout.
The Deployment controller's rolling update scales the new ReplicaSet up and the old ReplicaSet down directly. It enforces two constraints from the Deployment's own strategy: total pods must not exceed replicas + maxSurge (10), and unavailable pods (desired minus available) must not exceed maxUnavailable (3). The controller does not invoke the Eviction API; it changes the replica count of the old ReplicaSet, and the ReplicaSet controller then deletes pods. PodDisruptionBudgets are only consulted by the Eviction subresource, which is what kubectl drain and other voluntary-disruption tools call. Because the rollout bypasses eviction, the PDB with minAvailable=6 has no effect on it. The statement that the rollout is capped at 2 unavailable pods would only hold if the PDB were enforced on controller-driven deletions, which it is not. Rejection at admission is also wrong: the two settings are not incompatible, they simply govern different mechanisms.
Design a zero-downtime rollout strategy for a Kubernetes Deployment of a gRPC service with long-lived streaming connections. The deployment has 12 replicas across 3 nodes. Constraints: (1) New pods take ~60 seconds to warm up (JIT compilation + connection pool initialization) before they can serve traffic. (2) Existing gRPC streams must complete naturally — hard termination is unacceptable. (3) An external Layer-4 load balancer health-checks the ClusterIP Service via TCP every 5 seconds with a 3-second timeout. (4) Blast radius must be minimized if the new version is defective — a broken image should not affect more than a small fraction of replicas before you detect and stop it. Describe your Deployment spec (strategy, maxUnavailable, maxSurge), probe configuration (readiness/liveness), lifecycle hooks, terminationGracePeriodSeconds, PodDisruptionBudget, and any additional mechanisms needed to achieve zero connection drops during rolling updates.#
Show answer
- RollingUpdate Strategy: maxUnavailable=0, maxSurge=1. With maxUnavailable=0 the controller never terminates an old pod until a new one passes its readiness gate — total serving capacity never drops. maxSurge=1 keeps the blast radius to a single pod: if the new image is broken, only one extra pod is affected, and the rollout pauses when that pod fails readiness. 2. Readiness Probe: gRPC health check (grpc_health_probe or HTTP/2 health check) with initialDelaySeconds=75 (accounting for the ~60s warmup plus margin), periodSeconds=5, failureThreshold=3. The readiness gate ensures the pod is NOT added to the Service's Endpoints until it is genuinely warmed up — no traffic hits a cold pod. 3. Liveness Probe: Same gRPC health check but with initialDelaySeconds=120 (generous margin beyond readiness) and failureThreshold=5. This ensures liveness only kicks in after the pod should be fully operational, avoiding premature restarts during warmup. 4. preStop Lifecycle Hook: Configure a preStop hook that runs a command like
sleep 15(or a custom script that callsgrpc.Server.GracefulStop()and waits). This gives the pod time after deregistration from Endpoints but before SIGTERM — allowing the kubelet to remove it from iptables/IPVS rules and the external LB's 5-second health check to mark it unhealthy before the application starts draining. 5. terminationGracePeriodSeconds=120. After the preStop hook completes, SIGTERM is sent to the main container. The gRPC server should trap SIGTERM and call GracefulStop(), which waits for existing streams to finish. 120 seconds provides ample time for streams that may take up to ~60 seconds to complete. 6. PodDisruptionBudget: minAvailable=11 (or maxUnavailable=1). This prevents akubectl drainor autoscaler from evicting a pod while the rollout is in progress, avoiding the scenario where a voluntary eviction + rollout reduce capacity below safe levels. 7. Blast Radius & Rollback: With maxSurge=1, only one new pod is created at a time. If it fails readiness (failureThreshold×periodSeconds = 15s after the 75s initial delay), the Deployment'sProgressingcondition stalls andReplicaSetshows the new pod never becomes ready. SetprogressDeadlineSeconds=300so the Deployment automatically reports aProgressDeadlineExceededcondition, enabling automated rollback via an Argo Rollouts / Flagger controller or manualkubectl rollout undo. 8. External LB Interaction: The 5-second LB health check interval means up to ~8 seconds of stale endpoints. The preStop hook's 15-second sleep covers this window — by the time SIGTERM is delivered to the app, the LB has already stopped sending new connections. Combined withpublishNotReadyAddresses=false(default) on the Service, the pod is removed from Endpoints before the preStop hook even fires, giving the LB time to converge.
- Readiness Probe Configuration — Must describe a readiness probe with
initialDelaySecondstuned for the ~60s warmup (e.g., 75s) and explain that the readiness gate prevents the pod from being added to Service Endpoints until it is warmed up, so no traffic hits a cold pod.
A Deployment in a Kubernetes v1.29 cluster has replicas: 8, strategy: RollingUpdate, maxSurge: 25%, maxUnavailable: 0, and minReadySeconds: 0. All 8 pods are healthy and running the old image. A PodDisruptionBudget with an identical label selector is configured with minAvailable: 8. You then trigger a rollout by updating the container image to a new version whose pods take approximately 90 seconds to pass their readiness probe. progressDeadlineSeconds is unset (defaults to 600 s). Which statement is correct?#
Options
Show answer
The rollout proceeds normally. A Deployment rolling update creates surge pods and removes old pods as new ones become ready, without consulting the PodDisruptionBudget. PDBs only constrain voluntary evictions, such as those from kubectl drain, and the 90-second readiness delay stays well within the default 600-second progress deadline.
The Deployment controller performs a rolling update by scaling ReplicaSets: with maxSurge 25% of 8 (rounded up to 2) and maxUnavailable 0, it creates 2 surge pods with the new image, waits roughly 90 seconds for each to pass readiness, and then removes old pods one-for-one. The 90-second delay is well within the default 600-second progress deadline, so no ProgressDeadlineExceeded condition is raised. PodDisruptionBudgets are enforced only on the eviction API path used by tools like kubectl drain; the ReplicaSet controller deletes pods through the ordinary DELETE API, so the PDB's minAvailable: 8 does not gate the rollout at all.
Related interview questions
Job market
See kubernetes salaries and hiring demand from live job postings.
Practise these until they stick
That's every question we hold on this topic, and the page marks what you pick. What it can't do is remember. A free account keeps every answer, and what you miss comes back until it's right: after a day, then at longer gaps.
Free · the whole bank · 100 marked answers per 30 days · written feedback on the paid plan