Kubernetes pods can ping external IPs but not any domain
I have a Kubernetes cluster using the Antrea CNI.
The problem is that I can't curl
any domain names.
I can do nslookup
inside the pod and get the IP of any domain, but I can't directly curl the domain.
For example, I can't curl https://google.com
but I can curl https://1.1.1.1
Am I missing something, or is it normal? What do I need to do in order to fix this?
Here is the pod's container's ip route show table all
default via 10.42.4.1 dev eth0
10.42.4.0/24 dev eth0 scope link src 10.42.4.26
broadcast 10.42.4.0 dev eth0 table local scope link src 10.42.4.26
local 10.42.4.26 dev eth0 table local scope host src 10.42.4.26
broadcast 10.42.4.255 dev eth0 table local scope link src 10.42.4.26
broadcast 127.0.0.0 dev lo table local scope link src 127.0.0.1
local 127.0.0.0/8 dev lo table local scope host src 127.0.0.1
local 127.0.0.1 dev lo table local scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local scope link src 127.0.0.1
fe80::/64 dev eth0 metric 256
local ::1 dev lo table local metric 0
local fe80::e08c:e8ff:fef3:4877 dev eth0 table local metric 0
multicast ff00::/8 dev eth0 table local metric 256
My cluster's cidr is 10.42.0.0/16
Posting comment as the community wiki answer for better visibility:
Turns out restarting the coredns deployment fixed the issue. It was a bad coredns pod, which is now gladly fixed! Restarting things really does work.