Bird
0
0

Which of the following label selectors will correctly select pods labeled with app: frontend?

easy📝 Conceptual Q2 of 15
Kubernetes - Services
Which of the following label selectors will correctly select pods labeled with app: frontend?
Aselector: role: frontend
Bselector: app: backend
Cselector: app: frontend
Dselector: app: frontend env: prod
Step-by-Step Solution
Solution:
  1. Step 1: Identify the label to match

    The question asks for pods with label app: frontend.
  2. Step 2: Match selector syntax

    selector: app: frontend exactly matches the label key and value.
  3. Step 3: Analyze other options

    selector: app: backend matches a different app label, C uses a different key, and D adds an extra label which may exclude pods without that label.
  4. Final Answer:

    selector: app: frontend -> Option C
  5. Quick Check:

    Exact label match required [OK]
Quick Trick: Selector must exactly match label key and value [OK]
Common Mistakes:
  • Using wrong label key or value
  • Adding extra labels unintentionally
  • Confusing label keys with other metadata

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes