CKAD Application Deployment Practice Question
You are implementing a blue-green deployment using Kubernetes Deployments and Services. The 'blue' Deployment runs version 1.0, and the 'green' Deployment runs version 2.0. What is the key mechanism to switch traffic from blue to green?
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
✓
Update the Service's label selector to match the green Deployment's pod labels
By updating the Service's label selector to match the green Deployment's pod labels, the Service routes traffic to the new version.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Scale down the blue Deployment to 0 replicas
Why it's wrong here
Scaling down the blue Deployment to zero does not change the Service's label selector, which still targets pods with the blue labels. The Service will simply have no ready endpoints once the blue pods terminate, causing downtime rather than routing traffic to green. To shift traffic, the selector must be updated to match the green Deployment's pod labels; replica counts have no effect on Service routing.
- ✗
Delete the blue Deployment
Why it's wrong here
Deleting the blue Deployment is an unnecessary and destructive action that fails to update the Service selector, so the Service still tries to route to pods labeled as blue. If the green version is not yet selected, the Service will have zero endpoints and all requests will fail. Even if green is ready, deletion alone does nothing to make the Service select green pods; it only removes the old backend without a selector change.
- ✗
Change the Service type from ClusterIP to NodePort
Why it's wrong here
Changing the Service type from ClusterIP to NodePort only alters the Service's network exposure mechanism, such as creating a nodePort on each node for external access. It does not modify the spec.selector field, so the Service continues to route traffic to blue pods exactly as before. This change is irrelevant to a blue/green switch and may even introduce unintended external access to the old version.
- ✓
Update the Service's label selector to match the green Deployment's pod labels
Why this is correct
Updating the Service's label selector to match the green Deployment's pod labels is the correct control point for traffic shifting. When the selector changes, the EndpointSlice controller re-evaluates matching Pods and replaces blue pod IPs with green pod IPs, atomically switching the backend. This approach preserves the ability to instantly roll back by reverting the selector to blue labels, provided the blue Deployment remains available.
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.