Question 540
At Pinecrest logistics, in a sandbox Kubernetes cluster during a recovery tabletop exercise: Service dispatch-svc in fulfillment uses the wrong targetPort; the application container is listening on 9000 and Service port must remain 9090. 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
Check exposed Service port mappings against actual container listeners and named ports before releases. This reduces recurrence of the specific operational failure. It reinforces the action: Run kubectl -n fulfillment patch service dispatch-svc --type=merge -p '{"spec":{"ports":[{"port":9090,"targetPort":9000}]}}' for the lab's single-port Service. The relevant mechanism is: The Service port is what clients connect to, while targetPort must reach the actual backend listener.
Incorrect Answers
The suggested review tracks a different technical risk: An egress-isolating NetworkPolicy can block Pod outbound connections; DNS and required dependencies need explicit allowances. Here the sustained control must address: The Service port is what clients connect to, while targetPort must reach the actual backend listener. Choose “Check exposed Service port mappings against actual container listeners and named ports before releases”.
This routine guards against another mechanism: 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 recurring exposure in the current case is: The Service port is what clients connect to, while targetPort must reach the actual backend listener. The matching preventive check is “Check exposed Service port mappings against actual container listeners and named ports before releases”.
The suggested review tracks a different technical risk: Ingress TLS termination relies on a controller and a referenced TLS Secret; updating a Service alone does not install certificates. Here the sustained control must address: The Service port is what clients connect to, while targetPort must reach the actual backend listener. Choose “Check exposed Service port mappings against actual container listeners and named ports before releases”.