Service discovery is the process where workloads discover services without knowing their IP address. This topic describes how Anthos clusters on AWS (GKE on AWS) implements service discovery and managed domain name services (DNS).
Kubernetes automatically generates service names that use the following specification:
Workloads also access external services, like
example.com, using DNS names.
For more information on the behaviour of DNS in Kubernetes, see
DNS for Services and Pods.
Anthos clusters on AWS uses
to provide cluster DNS resolution. CoreDNS runs as a redundant, scaled
kube-system namespace. The CoreDNS deployment has a
Service that groups the CoreDNS Pods
and gives them a single IP address. The CoreDNS Deployment scales with the
cluster's size and usage.
Anthos clusters on AWS uses NodeLocal DNSCache to improve DNS lookup performance. NodeLocal DNSCache runs as a DaemonSet on each node in your cluster. When a Pod makes a DNS request, the request first goes to the DNS cache on the same node. If the cache can't resolve the DNS request, the cache forwards the request to either:
- CoreDNS for an internal name (for example,
- The Amazon DNS server,
for an external name (for example,
For an overview of how DNS is used in Kubernetes clusters, see DNS for Services and Pods.