DNS for Kubernetes Service
First of all, DNS for Kubernetes Service is most important from the service discovery point of view. This is because an application usually connects to Kubernetes Service instead of connecting to the pod. This is why the application looks up the DNS entry for Kubernetes Service more often than for the pod.
Secondly, the DNS entry for Kubernetes Service will use the name of Kubernetes Service instead of an IP address. For instance, it will look like this: <Service Name>.<Namespace name>.svc.cluster.local.
Lastly, Kubernetes Service has 2 different behaviors for DNS; either normal service or headless service. Normal service has its own IP address, while headless service uses the pod's IP address(es). Let's go through ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access