CKAD Application Deployment Practice Question
You need to perform a blue-green deployment using Deployments and Services. What is the most common approach to switch traffic from the old version (blue) to the new version (green)?
⚠ Common exam trap
Many candidates confuse a blue-green deployment with a rolling update or scaling strategy, and mistakenly think that updating the image (Option A) or scaling (Option D) is sufficient to switch traffic, ignoring the critical role of the Service's label selector in directing traffic to the correct set of pods.
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
✓
Change the Service's label selector to point to the green Deployment's pod labels
In a blue-green deployment, the Service acts as the traffic router by using a label selector to match pods. By updating the Service's selector to match the green Deployment's pod labels (e.g., `version: green`), traffic is instantly switched from blue pods to green pods without any downtime, as Kubernetes Services use label selectors to dynamically route traffic to matching pods.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Update the Deployment's image field in the blue Deployment to the new version
Why it's wrong here
Updating the image field on the blue Deployment triggers a rolling update, replacing blue pods with new-version pods gradually rather than creating a separate green environment. This is not a blue-green switch because there is no independent deployment to track the old version, and the service still selects the same pods, so you lose the ability to instantly roll back by toggling a selector. It also does not provide an instantaneous traffic switch; instead, you get a period of mixed versions during the rollout.
- ✓
Change the Service's label selector to point to the green Deployment's pod labels
Why this is correct
Altering the Service's label selector to match the green Deployment's pod labels is the canonical blue-green traffic switch. Because the Deployment labels are immutable to the selector only after the fact, you simply retarget the Service to the already-running and ready green pods, instantly moving all traffic without redeploying anything. This provides zero-downtime shifting and makes rollback trivial by reverting the selector to blue.
- ✗
Delete the blue Deployment and create the green Deployment
Why it's wrong here
Deleting the blue Deployment before the green Deployment is created would leave the Service with no matching endpoints, causing a complete outage until green is successfully deployed and its pods are ready. Blue-green deployment's key advantage is keeping the old version alive during validation; you should never delete it as part of the switch. Instead, create green, wait for it to be healthy, change the Service selector, and only then (optionally) scale down or delete blue.
- ✗
Scale the blue Deployment to 0 and the green Deployment to desired replicas
Why it's wrong here
Scaling blue to 0 while the Service still selects blue pod labels removes all endpoints, forcing downtime even though green is scaled up and running. The Service will not route to green pods because its selector still matches blue's labels; the selector must be updated for traffic to flow to green. This action also negates easy rollback because blue is already gone, whereas a proper blue-green switch leaves both versions intact and only flips the selector.
Go deeper
Related to this question
About these practice questions
Courseiva writes every CKAD question from scratch — 160 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.