2

After switching to a new router, I realized my pods inside my Kind Kubernetes cluster cannot access internet.

$ kubectl run --rm utils2 -it --image arunvelsriram/utils bash

inside the container now

$ ping google.com PING google.com.www.tendawifi.com (192.168.1.1) 56(84) bytes of data.

Somehow, ping goes to google.com.www.tendawifi.com.

I see this is because of some strange /etc/resolv.conf:

$ cat /etc/resolv.conf
search default.svc.cluster.local svc.cluster.local cluster.local www.tendawifi.com

When I do the same check on my host Linux machine, I see proper results.

What to check?

Ali Ok
  • 31

1 Answers1

1

I found it.

My router is somehow setting www.tendawifi.com as the search domain with DHCP on my host machine. Kind Kubernetes cluster is inheriting that search domain and I end up in this /etc/resolv.conf in my pods:

$ cat /etc/resolv.conf
search default.svc.cluster.local svc.cluster.local cluster.local www.tendawifi.com

I cannot find a way to disable it on the router. So, I ended up modifying the DHCP client settings on my Linux box.

In the /etc/dhcp/dhclient.conf file, make sure there's no domain-search asked. My latest configuration is below:

request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, host-name,
        dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
        netbios-name-servers, netbios-scope, interface-mtu,
        rfc3442-classless-static-routes, ntp-servers;

I need to kill and recreate my Kind cluster afterwards.

Ali Ok
  • 31