Bird
0
0

Why does a Kubernetes Service selector require exact label matches instead of partial or fuzzy matches?

hard📝 Conceptual Q10 of 15
Kubernetes - Services
Why does a Kubernetes Service selector require exact label matches instead of partial or fuzzy matches?
ABecause Kubernetes does not support labels on pods
BBecause selectors automatically match all pods in the cluster
CTo allow Services to select pods by IP address instead
DTo ensure precise routing to intended pods and avoid ambiguity
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of exact label matching

    Exact matches ensure Services route traffic only to the correct pods, avoiding mistakes or unintended targets.
  2. Step 2: Eliminate incorrect options

    Kubernetes supports labels on pods, selectors do not select by IP, and selectors do not match all pods automatically.
  3. Final Answer:

    To ensure precise routing to intended pods and avoid ambiguity -> Option D
  4. Quick Check:

    Exact label matching ensures precise pod selection [OK]
Quick Trick: Exact matches avoid routing mistakes and ambiguity [OK]
Common Mistakes:
  • Thinking selectors match pods by IP
  • Assuming fuzzy or partial label matches work
  • Believing selectors match all pods by default

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes