This page describes the CoreDNS upgrade process and how to install CoreDNS instead of kube-dns.
You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. If you do not already have a cluster, you can create one by using Minikube, or you can use one of these Kubernetes playgrounds:
Your Kubernetes server must be version v1.9 or later.
To check the version, enter
You can use CoreDNS instead of kube-dns in your cluster by replacing kube-dns in an existing deployment, or by using tools like kubeadm that will deploy and upgrade the cluster for you.
For manual deployment or replacement of kube-dns, see the documentation at the CoreDNS GitHub project.
In Kubernetes version 1.10 and later, you can also move to CoreDNS when you use
kubeadm to upgrade
a cluster that is using
kube-dns. In this case,
kubeadm will generate the CoreDNS configuration
(“Corefile”) based upon the
kube-dns ConfigMap, preserving configurations for federation,
stub domains, and upstream name server.
If you are moving from kube-dns to CoreDNS, make sure to set the
CoreDNS feature gate to
during an upgrade. For example, here is what a
v1.11.0 upgrade would look like:
kubeadm upgrade apply v1.11.0 --feature-gates=CoreDNS=true
In versions prior to 1.11 the Corefile will be overwritten by the one created during upgrade. You should save your existing ConfigMap if you have customized it. You may re-apply your customizations after the new ConfigMap is up and running.
If you are running CoreDNS in Kubernetes version 1.11 and later, during upgrade, your existing Corefile will be retained.
Note: In Kubernetes 1.11, CoreDNS has graduated to General Availability (GA) and is installed by default.
To install kube-dns instead, set the
CoreDNS feature gate
kubeadm init --feature-gates=CoreDNS=false
When resource utilisation is a concern, it may be useful to tune the configuration of CoreDNS. For more details, check out the documentation on scaling CoreDNS.
Was this page helpful?
Thanks for the feedback. If you have a specific, answerable question about how to use Kubernetes, ask it on Stack Overflow. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.