kubernetes-the-hard-way
kubernetes-the-hard-way copied to clipboard
Error from server: error dialing backend: dial tcp: lookup worker-1 on 127.0.0.53:53: server misbehaving
Hello. I'm stuck at "Deploying the DNS Cluster Add-on" lesson. When I'm trying to execute a DNS lookup, I've got the error
Error from server: error dialing backend: dial tcp: lookup worker-1 on 127.0.0.53:53: server misbehaving
I've set up my cluster on hetzner cloud, not in google cloud, may be it's the reason of this issue, Routing between working is correct, I can ping worker-1's pods from worker-0.
@AlexZalyalowa did you solve that?
@AlexZalyalowa did you solve that?
Nope.
your problem is as follows: your node hostnames need to be resolvable. maybe put all the master/worker nodes and their IPs into /etc/hosts on all nodes? I fixed this issue by pointing the nameserver in /etc/resolv.conf to my dns server and setting up entries of all my worker/master nodes in that dns server. Edit: that's the root cause. Solution can be specific to your cloud provider, I posted my solution for this problem on my local network.
Running the following command on all controller nodes made it work for me:
cat <<EOF | sudo tee -a hosts
10.240.0.20 worker-0
10.240.0.21 worker-1
10.240.0.22 worker-2
EOF
Add this to kube-apiserver arguments (in the systemd service): --kubelet-preferred-address-types=InternalIP,ExternalIP.
Default is Hostname,InternalIP,ExternalIP. So with this setting, it will try to talk to kubelets using the InternalIP first instead.