Question 660
At Pinecrest logistics, in a sandbox Kubernetes cluster during a recovery tabletop exercise: A policy ./policies/dispatch-api-peer.yaml is ready to permit Pod-to-Pod traffic only from trusted labels in namespace fulfillment. Work only within the stated target and verify before declaring success. Which operational control most directly prevents this failure or configuration drift?
Explanation
Correct Answer
Verify peer label governance and avoid permitting all namespace workloads accidentally. This reduces recurrence of the specific operational failure. It reinforces the action: Run kubectl -n fulfillment apply -f ./policies/dispatch-api-peer.yaml after verifying podSelector rules match the source identity. The relevant mechanism is: An ingress rule with a podSelector selects source Pods in its own namespace unless combined with other peer selectors.
Incorrect Answers
The suggested review tracks a different technical risk: A namespaceSelector in a NetworkPolicy ingress peer matches namespace labels; it differs from matching arbitrary Pod labels across namespaces. Here the sustained control must address: An ingress rule with a podSelector selects source Pods in its own namespace unless combined with other peer selectors. Choose “Verify peer label governance and avoid permitting all namespace workloads accidentally”.
That safeguard is relevant to: 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. The current failure instead follows from: An ingress rule with a podSelector selects source Pods in its own namespace unless combined with other peer selectors. Its prevention measure is “Verify peer label governance and avoid permitting all namespace workloads accidentally”.
This routine guards against another mechanism: NetworkPolicy egress rules are additive and DNS lookup requires permitted traffic to the DNS server, not only a correct Service record. The recurring exposure in the current case is: An ingress rule with a podSelector selects source Pods in its own namespace unless combined with other peer selectors. The matching preventive check is “Verify peer label governance and avoid permitting all namespace workloads accidentally”.