Study. uk . com
  1. Home
  2. All questions
  3. Question 800

CKA study material · question 800 of 1000

A NetworkPolicy in namespace web has an ingress rule whose from block contains only a podSelector matching app=api. Which Pods does it admit?

  1. Pods labelled app=api in any namespace
  2. Pods labelled app=api in namespace web only
  3. Pods labelled app=api in namespaces labelled web
  4. No Pods, since a namespaceSelector is required
Show the answer

Answer: B. Pods labelled app=api in namespace web only

A bare podSelector always selects within the NetworkPolicy's own namespace; reaching Pods elsewhere requires a namespaceSelector in the same entry.

Source: Network Policies (Kubernetes) — Behavior of to and from selectors

Challenge yourself on this topic → Study as cards