A cluster administrator notices that a NetworkPolicy applied to the database namespace is dropping traffic from the frontend namespace. The policy uses namespaceSelector. Which label must be present on the frontend namespace for traffic to be successfully allowed?
Trap 1: openshift.io/cluster-monitoring=true
This label is reserved for cluster monitoring and does not grant general network policy access.
Trap 2: security.openshift.io/scc=restricted
Security Context Constraints labels are for pod security, not network policy namespace selection.
Trap 3: kubernetes.io/metadata.name matching the namespace name
While kubernetes.io/metadata.name is automatically added in newer Kubernetes versions, standard custom labels defined in the namespaceSelector must match explicitly.
- A
openshift.io/cluster-monitoring=true
Why wrong: This label is reserved for cluster monitoring and does not grant general network policy access.
- B
security.openshift.io/scc=restricted
Why wrong: Security Context Constraints labels are for pod security, not network policy namespace selection.
- C
A custom label defined in the namespaceSelector of the NetworkPolicy spec
The namespace must carry the exact key-value pair specified in the namespaceSelector of the ingress rule.
- D
kubernetes.io/metadata.name matching the namespace name
Why wrong: While kubernetes.io/metadata.name is automatically added in newer Kubernetes versions, standard custom labels defined in the namespaceSelector must match explicitly.