Bird
0
0

Which of the following is the correct syntax for a set-based label selector to select pods with label tier in either frontend or backend?

easy📝 Syntax Q12 of 15
Kubernetes - Labels and Selectors
Which of the following is the correct syntax for a set-based label selector to select pods with label tier in either frontend or backend?
Atier in (frontend, backend)
Btier = (frontend, backend)
Ctier notin (frontend, backend)
Dtier == frontend || backend
Step-by-Step Solution
Solution:
  1. Step 1: Recall set-based selector syntax

    Set-based selectors use in or notin with parentheses listing values.
  2. Step 2: Match syntax to requirement

    To select pods where tier is either frontend or backend, use tier in (frontend, backend).
  3. Final Answer:

    tier in (frontend, backend) -> Option A
  4. Quick Check:

    Set-based selector uses 'in' with parentheses [OK]
Quick Trick: Use 'in' with parentheses for set-based inclusion [OK]
Common Mistakes:
  • Using '=' instead of 'in' for sets
  • Misplacing parentheses
  • Using '==' or '||' which are invalid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes