Description
Summary
Suddenly, pods can no longer access the internet. When I try to curl google.com
from inside a pod, it fails with "connection reset by peer" or a different error. On some very rare occasions, it gives a result, which does not equal curl google.com
from the host machine. DNS add-on is enabled, microk8s is running on an Ubuntu server 22.04 host and is up-to-date.
I have made the following observations running commands in pods:
Running nslookup
returns the same result for every external domain:
root@dnsutils:/# nslookup deb.debian.org
Server: 10.152.183.10
Address: 10.152.183.10#53
Non-authoritative answer:
Name: deb.debian.org.fritz.box
Address: 45.76.93.104
Running host
gives the same result as nslookup
:
root@dnsutils:/# host deb.debian.org
deb.debian.org.fritz.box has address 45.76.93.104
deb.debian.org.fritz.box has IPv6 address 2001:19f0:6c00:1b0e:5400:4ff:fecd:7828
dig
works fine, returning the correct IP address:
root@dnsutils:/# dig deb.debian.org
; <<>> DiG 9.9.5-9+deb8u19-Debian <<>> deb.debian.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41191
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;deb.debian.org. IN A
;; ANSWER SECTION:
deb.debian.org. 5 IN CNAME debian.map.fastlydns.net.
debian.map.fastlydns.net. 5 IN A 146.75.122.132
;; Query time: 20 msec
;; SERVER: 10.152.183.10#53(10.152.183.10)
;; WHEN: Thu Mar 14 12:10:46 UTC 2024
;; MSG SIZE rcvd: 135
Running curl
against the valid IP from google.com does work and return the correct result.
I have done the official Kubernetes DNS troubleshooting, however none of the mentioned error occurred. /etc/resolv.conf
in the pods looks like this:
search default.svc.cluster.local svc.cluster.local cluster.local fritz.box
nameserver 10.152.183.10
options ndots:5
I guess that some part of my DNS configuration is incorrect, but I have not changed anything before the internet broke, and the DNS add-on should work out of the box as far as I understand.