canonical/microk8s.io

Mention possibility to specify /etc/resolv.conf to 'microk8s.enable dns'

Closed this issue · 3 comments

Summary

I've been struggling with DNS issues in the last weeks and needed some time to figure out that one can pass /etc/resolv.conf as argument to microk8s.enable, i.e. microk8s.enable dns:/etc/resolv.conf. It's also worth noticing that the input isn't validated and passing garbage will cause Cluster DNS configuration errors.

Since this is a rather technical and content related issue that might be validated by the developer team, please forward this eventual or notify me and I'll do it.

I'll see if I can somehow add the information to https://discuss.kubernetes.io/t/microk8s-ipv6-dualstack-how-to/14507 that /etc/resolv.conf is a necessary forward afaik. In case you ever plan on writing a microk8s IPv6 setup howto, please validate that.

Process

I suggest

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:

microk8s enable dns:1.1.1.1

The argument can be /etc/resolv.conf as well if you want CoreDNS to consider your local setup. The forward dns servers can also be altered after enabling the addon by running the command:

Current and expected result

I've been experiencing a loop with systemd-resolved in conjunction with IPv6 configuration with Calico, so this is not something the average user will encounter and experienced users might invoke the already mentioned command microk8s kubectl -n kube-system edit configmap/coredns - would have saved me days if I just did that in the first place. I just didn't know that erroneous forward server is my problem (or what a forward server is for the same reason) and didn't bridge the gap between passing the argument and it being used as template value in the mentioned configmap. If you think that it's relevant for others, take it into consideration, if you think it's clear enough already, I understand.

Screenshot

./.

Browser details

./.

thanks for highlighting this. I will take a look at the current docs and see where we can fit something appropriate in

@evilnick shall I close this issue?

Closing - @evilnick has added it to docs.