Using CoreDNS for Service Discovery

    You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using or you can use one of these Kubernetes playgrounds:

    Your Kubernetes server must be at or later than version v1.9. To check the version, enter .

    About CoreDNS

    CoreDNS is a flexible, extensible DNS server that can serve as the Kubernetes cluster DNS. Like Kubernetes, the CoreDNS project is hosted by the .

    For manual deployment or replacement of kube-dns, see the documentation at the

    Migrating to CoreDNS

    In Kubernetes version 1.21, kubeadm removed its support for kube-dns as a DNS application. For kubeadm v1.26, the only supported cluster DNS application is CoreDNS.

    You can move to CoreDNS when you use to upgrade a cluster that is using kube-dns. In this case, kubeadm generates the CoreDNS configuration (“Corefile”) based upon the ConfigMap, preserving configurations for stub domains, and upstream name server.

    CoreDNS can be upgraded manually in case you want to only upgrade CoreDNS or use your own custom image. There is a helpful available to ensure a smooth upgrade. Make sure the existing CoreDNS configuration (“Corefile”) is retained when upgrading your cluster.

    If you are upgrading your cluster using the kubeadm tool, kubeadm can take care of retaining the existing CoreDNS configuration automatically.

    Tuning CoreDNS

    When resource utilisation is a concern, it may be useful to tune the configuration of CoreDNS. For more details, check out the .