Illumina Innovates with Rancher and Kubernetes
RKE provides the following DNS providers that can be deployed as add-ons:
CoreDNS was made the default in RKE v0.2.5 when using Kubernetes 1.14 and higher. If you are using an RKE version lower than v0.2.5, kube-dns will be deployed by default.
Available as of v0.2.5
CoreDNS can only be used on Kubernetes v1.12.0 and higher.
RKE will deploy CoreDNS as a Deployment with the default replica count of 1. The pod consists of 1 container: coredns. RKE will also deploy coredns-autoscaler as a Deployment, which will scale the coredns Deployment by using the number of cores and nodes. Please see Linear Mode for more information about this logic.
coredns
The images used for CoreDNS are under the system_images directive. For each Kubernetes version, there are default images associated with CoreDNS, but these can be overridden by changing the image tag in system_images.
system_images
If you only want the CoreDNS pod to be deployed on specific nodes, you can set a node_selector in the dns section. The label in the node_selector would need to match the label on the nodes for the CoreDNS pod to be deployed.
node_selector
dns
nodes: - address: 1.1.1.1 role: [controlplane,worker,etcd] user: root labels: app: dns dns: provider: coredns node_selector: app: dns
By default, CoreDNS will use the host configured nameservers (usually residing at /etc/resolv.conf) to resolve external queries. If you want to configure specific upstream nameservers to be used by CoreDNS, you can use the upstreamnameservers directive.
/etc/resolv.conf
upstreamnameservers
When you set upstreamnameservers, the provider also needs to be set.
provider
dns: provider: coredns upstreamnameservers: - 1.1.1.1 - 8.8.4.4
RKE will deploy kube-dns as a Deployment with the default replica count of 1. The pod consists of 3 containers: kubedns, dnsmasq and sidecar. RKE will also deploy kube-dns-autoscaler as a Deployment, which will scale the kube-dns Deployment by using the number of cores and nodes. Please see Linear Mode for more information about this logic.
kubedns
dnsmasq
sidecar
The images used for kube-dns are under the system_images directive. For each Kubernetes version, there are default images associated with kube-dns, but these can be overridden by changing the image tag in system_images.
Available as of v0.2.0
If you only want the kube-dns pod to be deployed on specific nodes, you can set a node_selector in the dns section. The label in the node_selector would need to match the label on the nodes for the kube-dns pod to be deployed.
nodes: - address: 1.1.1.1 role: [controlplane,worker,etcd] user: root labels: app: dns dns: provider: kube-dns node_selector: app: dns
By default, kube-dns will use the host configured nameservers (usually residing at /etc/resolv.conf) to resolve external queries. If you want to configure specific upstream nameservers to be used by kube-dns, you can use the upstreamnameservers directive.
dns: provider: kube-dns upstreamnameservers: - 1.1.1.1 - 8.8.4.4
You can disable the default DNS provider by specifying none to the dns provider directive in the cluster configuration. Be aware that this will prevent your pods from doing name resolution in your cluster.
none
dns: provider: none