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

CKA study material · question 796 of 1000

A NetworkPolicy must permit traffic from the namespace named monitoring, which carries no custom labels. What can the namespaceSelector match on?

  1. The automatic kubernetes.io/metadata.name label
  2. The namespace's UID
  3. A metadata.name field selector
  4. Nothing; the namespace must be labelled first
Show the answer

Answer: A. The automatic kubernetes.io/metadata.name label

The control plane sets an immutable kubernetes.io/metadata.name label on every namespace, which lets a policy select a namespace by name even though it cannot name one directly.

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

Challenge yourself on this topic → Study as cards