The Kubernetes DNS (Domain Name System) assigns DNS names to Services, allowing applications within the cluster to easily locate them.
A service’s fully qualified domain name has the following format:
service-name.namespace-name.svc.cluster-domain.example
The default cluster domain is
cluster.local
.Service DNS and Namespaces
A Service’s fully qualified domain name can be used to reach the service from within any Namespace in the cluster.
my-service.my-namespace.svc.cluster.local
However, Pods within the same Namespace can also simply use the service name.
my-service