Route 53 hosted zones · Lesson 6 of 8 · 3 min read
EKS and Route 53
How pods resolve names
Pods query CoreDNS (the kube-dns Service). CoreDNS answers *.cluster.local itself and forwards everything else to the VPC resolver (via the node's /etc/resolv.conf). So pods see:
- Kubernetes Service names,
- private hosted zone records associated with the cluster's VPC,
- interface endpoint private DNS,
- public DNS.
To resolve on-prem names from pods, either rely on Resolver forwarding rules associated with the VPC (preferred — works for nodes too) or add a CoreDNS server block forwarding that domain.
Test from inside the cluster:
kubectl run -it --rm dnstest --image=busybox:1.36 --restart=Never -- nslookup orders-db.internal.example.com
kubectl run -it --rm dnstest --image=nicolaka/netshoot --restart=Never -- dig +search orders-db.internal.example.com
kubectl -n kube-system logs -l k8s-app=kube-dns --tail=50
Enlarge diagram
Swipe sideways to see all of it, or tap to open it full screen.
External DNS
External DNS watches Ingresses and Services and creates Route 53 records automatically:
Enlarge diagram
Swipe sideways to see all of it, or tap to open it full screen.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: orders
annotations:
external-dns.alpha.kubernetes.io/hostname: orders.example.com
alb.ingress.kubernetes.io/scheme: internet-facing
spec:
ingressClassName: alb
rules:
- host: orders.example.com
http: { paths: [{ path: /, pathType: Prefix, backend: { service: { name: orders, port: { number: 80 } } } }] }
Key settings:
- Runs with an IAM role via IRSA/Pod Identity allowing
route53:ChangeResourceRecordSetson specific hosted zone ARNs androute53:ListHostedZones/ListResourceRecordSets. --domain-filter=example.comand--zone-id-filterto limit scope;--policy=upsert-onlyto never delete records (safer), orsyncto remove stale ones.--txt-owner-id=<cluster-name>— External DNS writes TXT ownership records so multiple clusters don't fight over the same records.- Works for both public and private zones (
--aws-zone-type=private).
For 50 microservices, External DNS plus GitOps-managed Ingress manifests means DNS follows deployments automatically and is reviewed through Git.