Kubeadm: Kubeadm DNS setup isn't compatible with stock ubuntu 18.04

Created on 3 May 2018  路  5Comments  路  Source: kubernetes/kubeadm

What keywords did you search in kubeadm issues before filing this one?

dns

Is this a BUG REPORT or FEATURE REQUEST?

BUG REPORT

Versions

kubeadm version 1.10.2

Environment:

  • Kubernetes version 1.10.2
  • Cloud provider or hardware configuration: hetzner cloud running ubuntu 18.04
  • OS (e.g. from /etc/os-release): Ubuntu 18.04 LTS (Bionic Beaver)

What happened?

Following the kubeadm guide creates a cluster that doesn't have a functional DNS.

What you expected to happen?

Following the kubeadm guide creates a cluster that works.

How to reproduce it (as minimally and precisely as possible)?

Follow the kubeadm setup doc.

Anything else we need to know?

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.

prioritimportant-soon

Most helpful comment

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

All 5 comments

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

Was this page helpful?
0 / 5 - 0 ratings