Bird
0
0

You run kubectl get pods -l app=frontend env=prod but get an error. What is the mistake?

medium📝 Troubleshoot Q14 of 15
Kubernetes - Labels and Selectors
You run kubectl get pods -l app=frontend env=prod but get an error. What is the mistake?
ALabels must be quoted
BUsing wrong resource type
CMissing comma between labels in the selector
Dkubectl does not support multiple labels
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the label selector syntax

    The command uses -l app=frontend env=prod without a comma between labels, which is invalid syntax.
  2. Step 2: Correct syntax requires comma separation

    Labels must be separated by commas like -l app=frontend,env=prod to work properly.
  3. Final Answer:

    Missing comma between labels in the selector -> Option C
  4. Quick Check:

    Separate multiple labels with commas [OK]
Quick Trick: Separate multiple labels with commas, no spaces [OK]
Common Mistakes:
  • Forgetting commas between multiple labels
  • Adding spaces instead of commas
  • Quoting labels unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes