Question 520
At Northstar finance, in an isolated training cluster during a scheduled maintenance rehearsal: Service invoice-svc in ledger targets no Pods because its selector says app=legacy while Deployment invoice-api labels Pods app=invoice-api. 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
Test Service selectors against actual Pod template labels during deployments and renames. This reduces recurrence of the specific operational failure. It reinforces the action: Run kubectl -n ledger patch service invoice-svc --type=merge -p '{"spec":{"selector":{"app":"invoice-api"}}}' after confirming the label is authoritative. The relevant mechanism is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods.
Incorrect Answers
This routine guards against another mechanism: Gateway API separates infrastructure listener ownership from application route attachments and depends on controller support. The recurring exposure in the current case is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The matching preventive check is “Test Service selectors against actual Pod template labels during deployments and renames”.
The suggested review tracks a different technical risk: LoadBalancer Services request external routing from a supported infrastructure controller; a bare cluster does not guarantee an external address. Here the sustained control must address: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Choose “Test Service selectors against actual Pod template labels during deployments and renames”.
That safeguard is relevant to: DNS resolution may fail when CoreDNS replicas are unhealthy even when the requested Service and Pod endpoints exist. The current failure instead follows from: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Its prevention measure is “Test Service selectors against actual Pod template labels during deployments and renames”.