Bird
0
0

What pods are selected by the label selector env notin (dev, test) given pods:

medium📝 Command Output Q5 of 15
Kubernetes - Labels and Selectors
What pods are selected by the label selector env notin (dev, test) given pods:
pod1: env=prod
pod2: env=dev
pod3: env=stage
Apod1 only
Bpod2 only
Cpod1 and pod3
Dpod2 and pod3
Step-by-Step Solution
Solution:
  1. Step 1: Understand 'notin' selector

    The selector matches pods whose 'env' label is not in the set (dev, test).
  2. Step 2: Check pods' env labels

    pod1 has env=prod (not in set), pod3 has env=stage (not in set), pod2 has env=dev (in set).
  3. Final Answer:

    pod1 and pod3 -> Option C
  4. Quick Check:

    'notin' excludes listed values [OK]
Quick Trick: Use 'notin' to exclude label values from selection [OK]
Common Mistakes:
  • Confusing 'notin' with 'in'
  • Selecting pods with excluded labels
  • Ignoring label values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes