Member-only story

DevOps in K8s — CoreDNS, Part One

DevOps in K8s bootcamp series

Tony
4 min readJul 21, 2023

Note, full “DevOps in K8s” mind map is available at: “DevOps in K8s Mind Map

What is CoreDNS

CoreDNS is the default DNS (Domain Name System) for service discovery in K8s (Kubernetes) as of version 1.13, replacing the previous kube-dns.

DNS is a critical part of how applications discover each other in a distributed system like K8s. When your applications run inside Pods in K8s, they might need to find other services by name. For instance, a front-end service might need to find a back-end service. This is where DNS comes into play.

CoreDNS is a flexible and extensible DNS server with a focus on service discovery. In K8s, CoreDNS provides a way to discover services (and Pods) by name, simplifying interservice communication.

When you create a Service in K8s, CoreDNS automatically creates DNS records for that service. Other applications in your K8s cluster can then discover the service simply by querying the service’s DNS name.

Example of CoreDNS pods:

$ kubectl get pods -n kube-system -l k8s-app=kube-dns
NAME READY STATUS RESTARTS AGE
coredns-347f954f9b-okpqq 1/1 Running 0 12m
coredns-347f954f9b-sr5r4 1/1…

--

--

Tony
Tony

Responses (2)