Question 570
At Horizon observability, in a disposable simulated environment during a monitored release window: Pods in namespace observability cannot resolve the local Service metrics-svc by its fully qualified name; test cluster DNS from inside a disposable Pod. Work only within the stated target and verify before declaring success. Which Kubernetes behavior best explains the required change or diagnosis?
Explanation
Correct Answer
Cluster DNS should resolve Service names inside its configured domain; host-side DNS results do not prove in-cluster resolution. This explains the stated condition. The corresponding action is: Run kubectl -n observability run metrics-api-dns-test --image=busybox:1.36 --restart=Never --command -- nslookup metrics-svc.observability.svc.cluster.local and inspect the Pod logs. The direct acceptance evidence is: Run kubectl -n observability logs metrics-api-dns-test and look for a valid Service address before deleting the test Pod.
Incorrect Answers
NetworkPolicy egress rules are additive and DNS lookup requires permitted traffic to the DNS server, not only a correct Service record. That explanation applies to a different technical failure. Here the controlling principle is: Cluster DNS should resolve Service names inside its configured domain; host-side DNS results do not prove in-cluster resolution.
The offered statement is true for this other 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. It does not explain the facts described here, which follow from: Cluster DNS should resolve Service names inside its configured domain; host-side DNS results do not prove in-cluster resolution.
This principle describes a separate cause: CoreDNS behavior is configured separately from Service definitions, and incorrect DNS plugins or cluster domain can break discovery cluster-wide. The reported condition is governed by: Cluster DNS should resolve Service names inside its configured domain; host-side DNS results do not prove in-cluster resolution. The two mechanisms should not be conflated.