By lanoxx


2018-10-11 13:21:50 8 Comments

I am new to Kubernetes and looking for a better understanding of the difference between Kube-DNS and CoreDNS.

As I understand it the recommendation is to use the newer CoreDNS rather than the older Kube-DNS.

I have setup a small cluster using kubeadm and now I am a little confused about the difference between CoreDNS and Kube-DNS.

Using kubectl get pods --all-namespaces I can see that I have two CoreDNS pods running.

However using kubectl get svc --all-namespaces I also see that I have a service named kube-dns running in the kube-system namespace. When I inspect that with kubectl describe svc/kube-dns -n kube-system I can see that the kube-dns service links to coredns.

I am now wondering if I am actually running both kube-dns and coredns. Or else, why is that service called kube-dns and not core-dns?

1 comments

@Praveen Sripati 2018-10-11 14:00:56

I have K8S 1.12. Do a describe of the dns pod.

kubectl describe pod coredns-576cbf47c7-hhjrs --namespace=kube-system | grep -i "image:"

Image: k8s.gcr.io/coredns:1.2.2

Looks like coredns is running. According to the documentation CoreDNS is default from K8S 1.11. For previous installations it's kube-dns.

The image is what important, rest are metadata (names, labels etc).

According to the K8S blog here.

In Kubernetes 1.11, CoreDNS has reached General Availability (GA) for DNS-based service discovery, as an alternative to the kube-dns addon. This means that CoreDNS will be offered as an option in upcoming versions of the various installation tools. In fact, the kubeadm team chose to make it the default option starting with Kubernetes 1.11.

Also, see this link for more info.

@lanoxx 2018-10-11 15:06:23

Is the corresponding service also named kube-dns on your side?

@Praveen Sripati 2018-10-11 15:22:04

Yes. This has been done for the sake of compatibility. The existing clients can still use kube-dns for invoking the service after moving from kube-dns to CoreDNS.

Related Questions

Sponsored Content

3 Answered Questions

[SOLVED] kubernetes service discovery with specific endpoint (DNS)

5 Answered Questions

[SOLVED] unable to access kubernetes dashboard via token

3 Answered Questions

[SOLVED] Cannot get kube-dns to start on Kubernetes

0 Answered Questions

Kubernetes dashboard pods is not running

1 Answered Questions

1 Answered Questions

[SOLVED] How to debug kubectl apply for kube-flannel.yml?

0 Answered Questions

Why the pod in Kubernetes cannot resolve a service name through kubedns?

  • 2017-11-21 14:54:48
  • X. Wang
  • 325 View
  • 0 Score
  • 0 Answer
  • Tags:   dns kubernetes

1 Answered Questions

issue on arm64: no endpoints,code:503

2 Answered Questions

[SOLVED] Kubernetes - connection refused diagnosis

  • 2017-03-14 21:07:48
  • Maurício Fernandes de Castro
  • 4774 View
  • 0 Score
  • 2 Answer
  • Tags:   kubernetes

1 Answered Questions

[SOLVED] Can't resolve 'kubernetes' by skydns serivce in Kubernetes

  • 2015-09-24 05:52:45
  • sope
  • 826 View
  • 1 Score
  • 1 Answer
  • Tags:   kubernetes

Sponsored Content