You have found a Kubernetes issue #22770, where there is a workaround mentioned here and it goes like follows:
What you're experiencing is a known issue with k8s where for some operations it expects to be able to resolve your node names in the global DNS.
And suggested a work around would be to:
- Add entries to /etc/hosts on the master mapping your hostnames to their public IPs
- Install dnsmasq on the master (e.g. apt install -y dnsmasq)
- Kill the k8s api server container on master (kubelet will recreate it)
- Then systemctl restart docker (or reboot the master) for it to pick up the /etc/resolv.conf changes
As last comment on the issue #22770 there is
I can confirm that adding the names of the our nodes to /etc/hosts on the kubernetes master resolves this problem for us too :)
, so there is not a fix in k8s coming in any upcoming version. At least from this particular ticket.