Bird
0
0

You want to select pods with label 'app' equal to 'web' and label 'env' not in ('dev', 'test'). Which selector is correct?

hard📝 Workflow Q8 of 15
Kubernetes - Labels and Selectors
You want to select pods with label 'app' equal to 'web' and label 'env' not in ('dev', 'test'). Which selector is correct?
Aapp in (web), env!=dev,test
Bapp=web, env notin (dev, test)
Capp=web env notin dev test
Dapp==web, env notin (dev, test)
Step-by-Step Solution
Solution:
  1. Step 1: Understand combined selector syntax

    Multiple selectors are separated by commas and combined with AND logic.
  2. Step 2: Validate each part

    app=web is correct equality selector; env notin (dev, test) correctly excludes 'dev' and 'test'.
  3. Final Answer:

    app=web, env notin (dev, test) -> Option B
  4. Quick Check:

    Combine selectors with commas and correct syntax [OK]
Quick Trick: Use commas to combine multiple label selectors [OK]
Common Mistakes:
  • Using spaces instead of commas
  • Incorrect operator usage
  • Missing parentheses in 'notin'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes