Question 13
Domain 3: Services & NetworkingWhat is the correct in-cluster DNS name for the backend application in namespace `backend` to reach the `web-ui` Service in namespace `frontend` on port 3000?
Correct answer: A
Explanation
In Kubernetes, a Service is addressed by its fully qualified in-cluster DNS name: "<service>.<namespace>.svc.cluster.local". For the `web-ui` Service in namespace `frontend`, that name is "web-ui.frontend.svc.cluster.local", which lets the backend app resolve it on port 3000.
Why each option is right or wrong
A. web-ui.frontend.svc.cluster.local
Kubernetes Service discovery uses the cluster DNS suffix `svc.cluster.local`, with the Service name first and the namespace second: `<service>.<namespace>.svc.cluster.local`. Here, the target Service is `web-ui` in the `frontend` namespace, so the fully qualified in-cluster name is `web-ui.frontend.svc.cluster.local`; the backend namespace does not change the destination name, only where the caller is running.
B. web-ui.backend.svc.cluster.local
C. web-ui.frontend.pod.cluster.local
D. web-ui.frontend.service.cluster.local