CKAD Application Deployment Practice Question
You have a Deployment named 'web-app' with 5 replicas. You want to perform a rolling update with a maximum of 2 extra pods during the update and allow at most 1 pod to be unavailable. Which YAML snippet correctly configures the rolling update strategy?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
strategy: type: RollingUpdate rollingUpdate: maxSurge: 2 maxUnavailable: 1
Ly sets maxSurge to 2 and maxUnavailable to 1. maxSurge: 2 allows up to 2 extra pods above the desired 5 replicas (total 7). maxUnavailable: 1 ensures at most 1 pod is unavailable during the update, meeting the requirement of allowing at most 1 unavailable pod.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
strategy: type: RollingUpdate rollingUpdate: maxSurge: 3 maxUnavailable: 0
Why it's wrong here
Setting maxUnavailable to 0 means the Deployment is not allowed to have any unavailable replicas during the rollout, so every old pod must remain healthy until a new replacement is ready. Combined with maxSurge=3, the controller may temporarily create up to 8 pods (5 desired + 3 surge), but if any existing pod becomes unhealthy or fails readiness, the rollout stalls because the controller cannot terminate it while maintaining all 5 available. This configuration is overly conservative and can lead to update deadlocks, making it incorrect for a requirement of 5 replicas with 1 allowed down.
- ✗
strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 2
Why it's wrong here
With maxSurge=1 and maxUnavailable=2, the Deployment is permitted to have up to 2 replicas unavailable, meaning at least 3 of the desired 5 must be running, which violates the constraint that only 1 pod may be down (at least 4 available). Additionally, maxSurge=1 only creates at most 6 total pods, providing no headroom for both a surge and a temporary loss; the update would experience excessive downtime and fail to meet the availability spec.
- ✗
strategy: type: RollingUpdate rollingUpdate: maxSurge: "50%" maxUnavailable: "20%"
Why it's wrong here
Using percentages fundamentally changes the semantics: for a Deployment with 5 replicas, 50% maxSurge rounds up to 3 (not 2) and 20% maxUnavailable rounds down to 1, resulting in an effective policy of maxSurge=3, maxUnavailable=1. This does not match the requested absolute values of 2 and 1, and the question explicitly asks for exact integers. Percentage-based values are also dependent on replica count and rounding rules, making them less predictable for small replica sets.
- ✓
strategy: type: RollingUpdate rollingUpdate: maxSurge: 2 maxUnavailable: 1
Why this is correct
This is the correct configuration: maxSurge=2 allows the Deployment to temporarily run up to 7 pods (5 desired + 2 extra), while maxUnavailable=1 guarantees that no more than 1 of the 5 desired replicas is unavailable, so at least 4 are always serving traffic. The controller first creates 2 new pods, then terminates old ones in a controlled manner, maintaining both the surge cap and availability floor. These values exactly match the requirement of allowing 2 extra pods and 1 unavailable pod during the update.
Go deeper
Related to this question
About these practice questions
Courseiva writes every CKAD question from scratch — 826 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKAD practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKAD exam.