Bird
0
0

Given the following Kubernetes Service selector for blue deployment:

medium📝 Command Output Q13 of 15
Kubernetes - Advanced Deployment Patterns
Given the following Kubernetes Service selector for blue deployment:
selector:
  app: myapp
  version: blue

What happens if you change the selector to version: green?
ATraffic will be split evenly between blue and green pods
BTraffic will be routed to pods labeled with version green
CTraffic will stop because selector is invalid
DPods with version blue will receive traffic
Step-by-Step Solution
Solution:
  1. Step 1: Understand Service selector role

    The Service selector chooses pods matching the labels to send traffic to.
  2. Step 2: Effect of changing selector

    Changing selector to version: green directs traffic only to pods labeled green, ignoring blue pods.
  3. Final Answer:

    Traffic will be routed to pods labeled with version green -> Option B
  4. Quick Check:

    Selector change = traffic to matching pods [OK]
Quick Trick: Service selector controls which pods get traffic [OK]
Common Mistakes:
  • Assuming traffic splits automatically
  • Thinking selector change breaks traffic
  • Believing old pods still get traffic

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes