Bird
0
0

Which kubectl command lists all pods with the label tier=backend?

easy📝 Conceptual Q2 of 15
Kubernetes - Labels and Selectors
Which kubectl command lists all pods with the label tier=backend?
Akubectl list pods -label tier=backend
Bkubectl describe pods --label tier=backend
Ckubectl get pods -l tier=backend
Dkubectl get pods --filter tier=backend
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct label filtering syntax

    The -l or --selector flag is used with kubectl get to filter by label.
  2. Step 2: Match command to syntax

    kubectl get pods -l tier=backend correctly filters pods by label.
  3. Final Answer:

    kubectl get pods -l tier=backend -> Option C
  4. Quick Check:

    Label filter syntax = -l [OK]
Quick Trick: Use -l flag with kubectl get to filter by label [OK]
Common Mistakes:
  • Using --filter instead of -l
  • Using kubectl describe instead of get
  • Incorrect command verbs like list

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes