Bird
0
0

You have this Service selector:

medium📝 Troubleshoot Q7 of 15
Kubernetes - Services
You have this Service selector:
selector:
  app: backend
But it routes traffic to pods with env=dev. What is the likely cause?
APods have multiple labels and the selector matches only app label
BSelector syntax is invalid and ignored
CService automatically ignores env label in selector
DPods with env=dev are selected because of label inheritance
Step-by-Step Solution
Solution:
  1. Step 1: Understand selector matching behavior

    Selector requires all labels to match, but if pods have multiple labels, partial matches can cause confusion if labels are duplicated or misread.
  2. Step 2: Identify why pods with env=dev are selected

    Pods may have app=backend and env=dev, so selector matches only app label regardless of other labels like env.
  3. Final Answer:

    Pods have multiple labels and the selector matches only app label -> Option A
  4. Quick Check:

    Selector matches all labels; partial matches cause unexpected routing [OK]
Quick Trick: Selector matches all labels; partial matches cause issues [OK]
Common Mistakes:
  • Assuming selector ignores some labels
  • Believing label inheritance exists
  • Thinking invalid syntax is silently ignored

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes