繁体   English   中英

kubernetes荚用DNS查询的意外来源回复

[英]kubernetes pods replying with unexpected source for DNS queries

我有一个kubernetes +法兰绒设置。 法兰配置为{"Network": "10.200.0.0/16", "SubnetLen":24, "Backend": {"Type": "vxlan"}}

我使用--service-cluster-ip-range=10.32.0.0/24启动了apiserver。 据我了解,pod地址由法兰绒管理,service-cluster-ip-range由iptables管理。 我运行kubedns并尝试从kubernetes worker节点执行dig,以进行我正在运行的部署。

$ dig phonebook.default.svc.cluster.local @10.32.0.10 +short
10.32.0.7

但是,当我从Pod中运行的容器之一运行相同的命令时,我得到:

$ dig phonebook.default.svc.cluster.local
;; reply from unexpected source: 10.200.16.10#53, expected 10.32.0.10#53
;; reply from unexpected source: 10.200.16.10#53, expected 10.32.0.10#53
;; reply from unexpected source: 10.200.16.10#53, expected 10.32.0.10#53

; <<>> DiG 9.9.5-9+deb8u8-Debian <<>> phonebook.default.svc.cluster.local
;; global options: +cmd
;; connection timed out; no servers could be reached

知道这里可能有什么问题吗?

在kube-proxy上添加--masquerade-all标志,为我解决了这个问题。 似乎iptables不会伪装没有此标志的请求,这会导致dns查找失败。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM