大网数据广告活动
服务器运维问答

Kubernetes pods can ping external IPs but not any domain

· 52CE 我爱测

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 h…

问题原文

原帖链接 · tymur999 · CC BY-SA 4.0

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

已采纳解答

原帖链接 · Bazhikov · CC BY-SA 4.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-10-30)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。