dns
BUG REPORT
kubeadm version 1.10.2
Environment:
Following the kubeadm guide creates a cluster that doesn't have a functional DNS.
Following the kubeadm guide creates a cluster that works.
Follow the kubeadm setup doc.
It seems that 18.04 had switched to systemd-resolved by default, which generates a managed /etc/resolv.conf on the host:
nameserver 127.0.0.53
it's not a problem for docker at it will override the DNS with google dns, but kubeadm spins up coredns pods (or kubedns) with dns policy set to "default", meaning that the dns pod will have itself as a resolver. For coredns that means it will crashloop on any external name resolution as it's OOMing on the query recursion.
I'd think the best way to move forward with this is to allow kubeadm to manage dnsConfig of the resolver pod, but given it's an alpha feature, kubeadm should at least do a sanity check and not allow a cluster to be created if the host resolv.conf is pointing at localhost.
Happens to me on Ubuntu 18.04 as well. I tried with both coredns and kube-dns and they both fail. Are there any known workarounds either in Kubernetes or the OS?
Answering my own question. Workaround is to use the legacy format resolv.conf that systemd-resolved provides:
sudo rm /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
/assign @detiber - This overlaps with the other issue that is on your plate.
Closing as a duplicate of https://github.com/kubernetes/kubeadm/issues/273.
Thanks for filing this issue though, it made us re-prioritize this bug :+1:
@detiber I am still facing this issue with minikube 1.9.2, k8s v1.15.12 and ubuntu 18.04.4. Tried the mentioned work around but it didn't work. Could you please suggest something?
I am trying to access a service exposed as NodePort. Things used to work perfectly until my system crashed and I had to re-install Ubuntu and minikube. Facing this issue since 2 days.
Please go through this issue for more details.
I would really appreciate any help.
Thanks
Most helpful comment
Answering my own question. Workaround is to use the legacy format resolv.conf that systemd-resolved provides: