- Which DNS solution is implemented?
- How many DNS server pods are deployed?
- What Service name exposes CoreDNS?
- What is the Service ClusterIP used by pods for DNS lookups?
- Where is the CoreDNS configuration stored and how is it mounted into the pods?
1. Set a kubectl alias and list kube-system pods
Use a short alias for kubectl to speed up commands:- DNS implementation: CoreDNS (pods named
coredns-*). - Number of CoreDNS pods: 2.
2. Find the Kubernetes Service for DNS
List Services in the kube-system namespace to locate the DNS Service:- Service name exposing CoreDNS:
kube-dns - Service ClusterIP (used by pods):
10.96.0.10
3. Inspect a CoreDNS pod to find the Corefile and mounts
Describe one of the CoreDNS pods to inspect container arguments, mounts, and volumes:- CoreDNS reads its configuration from
/etc/coredns/Corefile(see-conf /etc/coredns/Corefile). - The
/etc.corednsdirectory is mounted from a volume namedconfig-volume. config-volumeis a ConfigMap volume sourced from thecorednsConfigMap.
CoreDNS configuration (the Corefile) is typically stored in the
coredns ConfigMap in the kube-system namespace and volume-mounted into the CoreDNS pods at /etc/coredns/Corefile. You can inspect it with kubectl get configmap coredns -n kube-system -o yaml.4. Quick reference — answers
5. Useful links and commands
- Inspect the CoreDNS ConfigMap:
kubectl get configmap coredns -n kube-system -o yaml
- Kubernetes DNS overview: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
- CoreDNS upstream docs: https://coredns.io/
Tip: If you need to edit the CoreDNS Corefile, update the
coredns ConfigMap and then restart the CoreDNS pods (or let the Deployment/DaemonSet roll them) so the new Corefile is picked up.