Question 1000
At Northstar finance, in an isolated training cluster during a scheduled maintenance rehearsal: Deployment invoice-api in ledger has healthy Pods with unexpected labels, and its selector no longer matches the intended Pod template. 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
Validate selector and template-label consistency before initial resource creation. This reduces recurrence of the specific operational failure. It reinforces the action: Run kubectl -n ledger get deployment invoice-api -o yaml and inspect immutable selector and Pod-template labels before planning controlled replacement. The relevant mechanism is: A Deployment selector identifies Pods it owns and is generally immutable after creation; patching Service selectors alone does not repair ownership.
Incorrect Answers
This routine guards against another mechanism: A Service may exist without usable backends because labels or Pod readiness do not match expected routing. The recurring exposure in the current case is: A Deployment selector identifies Pods it owns and is generally immutable after creation; patching Service selectors alone does not repair ownership. The matching preventive check is “Validate selector and template-label consistency before initial resource creation”.
The suggested review tracks a different technical risk: The scheduler places Pods by requested resources and constraints, not the current shell's observed free CPU alone. Here the sustained control must address: A Deployment selector identifies Pods it owns and is generally immutable after creation; patching Service selectors alone does not repair ownership. Choose “Validate selector and template-label consistency before initial resource creation”.
That safeguard is relevant to: A NoSchedule taint excludes Pods lacking a matching toleration even if the Node has free resources. The current failure instead follows from: A Deployment selector identifies Pods it owns and is generally immutable after creation; patching Service selectors alone does not repair ownership. Its prevention measure is “Validate selector and template-label consistency before initial resource creation”.