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

CKA study material · question 265 of 1000

How does a NetworkPolicy target a namespace by its name?

  1. It cannot; only labels apply
  2. With an ipBlock covering the namespace
  3. With a namespaceName field
  4. With a namespaceSelector matching the kubernetes.io/metadata.name label
Show the answer

Answer: D. With a namespaceSelector matching the kubernetes.io/metadata.name label

The control plane stamps an immutable kubernetes.io/metadata.name label on every namespace for exactly this.

Source: Network Policies (Kubernetes) — Targeting a Namespace by its name

Challenge yourself on this topic → Study as cards