Question 670
At Pinecrest logistics, in a sandbox Kubernetes cluster during a recovery tabletop exercise: Service backend Pods for dispatch-api in fulfillment must accept port 9090 traffic from a namespace carrying label access=approved via a reviewed policy file. Work only within the stated target and verify before declaring success. Which Kubernetes behavior best explains the required change or diagnosis?
Explanation
Correct Answer
A namespaceSelector in a NetworkPolicy ingress peer matches namespace labels; it differs from matching arbitrary Pod labels across namespaces. This explains the stated condition. The corresponding action is: Run kubectl -n fulfillment apply -f ./policies/dispatch-api-cross-namespace.yaml after confirming its namespaceSelector and TCP port 9090. The direct acceptance evidence is: Run authorized connectivity probes from both approved and unapproved namespaces.
Incorrect Answers
This principle describes a separate cause: A NodePort Service allocates a cluster-configured host port on each node while retaining its cluster IP routing. The reported condition is governed by: A namespaceSelector in a NetworkPolicy ingress peer matches namespace labels; it differs from matching arbitrary Pod labels across namespaces. The two mechanisms should not be conflated.
A selecting NetworkPolicy with ingress isolation and no allow rules denies new ingress to selected Pods except protocol-specific policy behavior; it does not itself control egress. That explanation applies to a different technical failure. Here the controlling principle is: A namespaceSelector in a NetworkPolicy ingress peer matches namespace labels; it differs from matching arbitrary Pod labels across namespaces.
The offered statement is true for this other mechanism: EndpointSlices represent Service backend addresses and readiness; Service existence alone does not prove endpoints exist. It does not explain the facts described here, which follow from: A namespaceSelector in a NetworkPolicy ingress peer matches namespace labels; it differs from matching arbitrary Pod labels across namespaces.