Bird
0
0

You ran kubectl get pods -l app=web but no pods were returned, even though pods exist with that label. What might be wrong?

medium📝 Troubleshoot Q7 of 15
Kubernetes - Labels and Selectors
You ran kubectl get pods -l app=web but no pods were returned, even though pods exist with that label. What might be wrong?
ALabels only work on services, not pods
BPods with label 'app=web' are automatically deleted
CYou used the wrong label key or value in the selector
Dkubectl cannot filter pods by labels
Step-by-Step Solution
Solution:
  1. Step 1: Verify label selector correctness

    If the label key or value is mistyped, no pods match.
  2. Step 2: Eliminate other causes

    Pods are not deleted automatically; kubectl supports label filtering; labels work on pods.
  3. Final Answer:

    You used the wrong label key or value in the selector -> Option C
  4. Quick Check:

    Label selector must match exactly = D [OK]
Quick Trick: Double-check label keys and values in selectors [OK]
Common Mistakes:
  • Assuming pods are deleted automatically
  • Thinking kubectl can't filter by labels
  • Believing labels don't apply to pods

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes