Add-on dns

This deploys CoreDNS to supply address resolution services to
Kubernetes.

This service is commonly required by other addons, so it is
recommended that you enable it.

  1. microk8s enable dns

By default it points to Google’s 8.8.8.8 and 8.8.4.4 servers for resolving
addresses. This can be changed when you enable the addon, for example:

  1. microk8s enable dns:1.1.1.1

The forward dns servers can also be altered after enabling the addon
by running the command:

  1. microk8s kubectl -n kube-system edit configmap/coredns

This will invoke the vim editor so that you can alter the configuration.

The addon can be disabled at any time:

  1. microk8s disable dns

…but bear in mind this could have implications for services and pods which
may be relying on it.

Last updated 6 months ago. Help improve this document in the forum.