Kubernetes kube-dns restarts on master node

2/26/2019

I have Kubernetes cluster on Ubuntu 16.04 servers, deployed using Kubespray.

Kube-dns pod is restarting continuously on master node. It has restarted 3454 times.

Can anyone let me know how to troubleshoot and solve this issue?

Starting logs of kube-dns: # 1, # 2

k8s-cluster.yml #1 #2

-- Ankita
kube-dns
kubernetes
ubuntu-16.04

1 Answer

2/27/2019

SkyDNS by default forwards the nameservers to the ones listed in the /etc/resolv.conf. Since SkyDNS runs inside the kube-dns pod as a cluster addon, it inherits the configuration of /etc/resolv.conf from its host as described in the kube-dns documentations.

From your error, it looks like your host's /etc/resolv.conf is configured to use 10.233.100.1 as its nameserver and that becomes the forwarding server in your SkyDNS config. Looks like 10.233.100.1 is not routable from your Kubernetes cluster and this is the reason why you are getting the error:

skydns: failure to forward request "read udp 10.233.100.1:40155->ourdnsserverIP:53:  i/o timeout"

The solution would be to change the flag --nameservers in the SkyDNS configuration. I said change because currently you have it set to "" and you might change it to nameservers=8.8.8.8:53,8.8.4.4:53.

-- Crou
Source: StackOverflow