Sourced from: https://github.com/coredns/deployment.git
CoreDNS has been the default DNS provider for Charmed Kubernetes clusters since 1.14.
For additional control over CoreDNS, you can also deploy it into the cluster
using the CoreDNS Kubernetes operator charm. To do so, set
the dns-provider
kubernetes-control-plane configuration option to none
and
deploy the charm into a Kubernetes model on your cluster. You’ll also need
to cross-model relate it to kubernetes-control-plane:
juju config -m cluster-model kubernetes-control-plane dns-provider=none
juju add-k8s k8s-cloud --controller mycontroller
juju add-model k8s-model k8s-cloud
juju deploy coredns --trust
juju offer coredns:dns-provider
juju consume -m cluster-model k8s-model.coredns
juju relate -m cluster-model coredns kubernetes-control-plane
Once everything settles out, new or restarted pods will use the CoreDNS charm as their DNS provider. The CoreDNS charm config allows you to change the cluster domain, the IP address or config file to forward unhandled queries to, add additional DNS servers, or even override the Corefile entirely.
It is also possible to use kube-dns
as the DNS provider, or turn off DNS
altogether using the dns-provider
kubernetes-control-plane configuration.