Question 640
At Northstar finance, in an isolated training cluster during a scheduled maintenance rehearsal: After egress isolation, app=invoice-api in ledger must be allowed to query cluster DNS using reviewed manifest ./policies/invoice-api-dns.yaml. 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
Include DNS as an explicit dependency when designing egress policies for isolated Pods. This reduces recurrence of the specific operational failure. It reinforces the action: Run kubectl -n ledger apply -f ./policies/invoice-api-dns.yaml where egress grants UDP and TCP 53 to validated DNS destinations. The relevant mechanism is: NetworkPolicy egress rules are additive and DNS lookup requires permitted traffic to the DNS server, not only a correct Service record.
Incorrect Answers
That safeguard is relevant to: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The current failure instead follows from: NetworkPolicy egress rules are additive and DNS lookup requires permitted traffic to the DNS server, not only a correct Service record. Its prevention measure is “Include DNS as an explicit dependency when designing egress policies for isolated Pods”.
This routine guards against another mechanism: An ingress rule with a podSelector selects source Pods in its own namespace unless combined with other peer selectors. The recurring exposure in the current case is: NetworkPolicy egress rules are additive and DNS lookup requires permitted traffic to the DNS server, not only a correct Service record. The matching preventive check is “Include DNS as an explicit dependency when designing egress policies for isolated Pods”.
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: NetworkPolicy egress rules are additive and DNS lookup requires permitted traffic to the DNS server, not only a correct Service record. Its prevention measure is “Include DNS as an explicit dependency when designing egress policies for isolated Pods”.