Bird
0
0

Which label selector will a Service use to route traffic to pods labeled env=production?

easy📝 Conceptual Q2 of 15
Kubernetes - Labels and Selectors
Which label selector will a Service use to route traffic to pods labeled env=production?
Aselector: env-production
Bselector: env:production
Cselector: environment=production
Dselector: env=production
Step-by-Step Solution
Solution:
  1. Step 1: Understand label selector syntax

    Selectors use key=value pairs exactly matching pod labels.
  2. Step 2: Match the correct syntax

    Correct syntax is key=value, so env=production is valid.
  3. Final Answer:

    selector: env=production -> Option D
  4. Quick Check:

    Correct label selector syntax = B [OK]
Quick Trick: Use key=value format for label selectors [OK]
Common Mistakes:
  • Using dash instead of equals sign
  • Using colon instead of equals
  • Changing label key name

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes