Bird
0
0

In a Kubernetes NetworkPolicy, what does the podSelector field define?

easy📝 Conceptual Q2 of 15
Kubernetes - RBAC and Security
In a Kubernetes NetworkPolicy, what does the podSelector field define?
AThe external IP addresses allowed to access pods
BThe group of pods to which the policy applies
CThe ports exposed by the pods
DThe namespaces where the policy is enforced
Step-by-Step Solution
Solution:
  1. Step 1: Understand podSelector purpose

    podSelector specifies which pods the NetworkPolicy targets within the namespace.
  2. Step 2: Differentiate from other fields

    It does not specify IP addresses, ports, or namespaces directly.
  3. Final Answer:

    The group of pods to which the policy applies -> Option B
  4. Quick Check:

    podSelector targets pods by labels [OK]
Quick Trick: podSelector targets pods by labels [OK]
Common Mistakes:
  • Confusing podSelector with IPBlock or namespaceSelector
  • Assuming podSelector defines ports
  • Thinking podSelector controls namespaces

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes