Question 390
At Horizon observability, in a disposable simulated environment during a monitored release window: The Deployment metrics-api in namespace observability must read keys from existing test Secret lab-metrics-key as environment variables. Work only within the stated target and verify before declaring success. Which Kubernetes behavior best explains the required change or diagnosis?
Explanation
Correct Answer
Pod templates can reference Secret keys without copying literal secret values into the Deployment spec. This explains the stated condition. The corresponding action is: Run kubectl -n observability set env deployment/metrics-api --from=secret/lab-metrics-key. The direct acceptance evidence is: Run kubectl -n observability describe deployment metrics-api and inspect environment key references without printing secret values.
Incorrect Answers
HPA evaluates metrics relative to Pod resource requests; missing metrics or requests can leave desired replicas unknown. That explanation applies to a different technical failure. Here the controlling principle is: Pod templates can reference Secret keys without copying literal secret values into the Deployment spec.
The offered statement is true for this other mechanism: Kubernetes Secrets are API objects intended for sensitive values, but literals in a shell command can leak via shell history and process observation. It does not explain the facts described here, which follow from: Pod templates can reference Secret keys without copying literal secret values into the Deployment spec.
A toleration allows a Pod past a matching taint but does not ensure placement without node selection and capacity. That explanation applies to a different technical failure. Here the controlling principle is: Pod templates can reference Secret keys without copying literal secret values into the Deployment spec.