Kube-proxy:无法检索节点 IP

Kube-proxy: Failed to retrieve node IP

我一个月前用kubeadm部署了一个v1.13.0的kubernetes集群,里面有一个master-node和三个worker-node。一切正常。
但是当我要向这个集群注册一个新的工人时。 kube-proxy deamonset 容器启动时出现以下错误日志:

W0103 09:41:57.631256       1 proxier.go:477] Failed to load kernel module ip_vs with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules  
W0103 09:41:57.631256       1 proxier.go:477] Failed to load kernel module ip_vs with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
W0103 09:41:57.631983       1 proxier.go:477] Failed to load kernel module ip_vs_rr with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
W0103 09:41:57.632666       1 proxier.go:477] Failed to load kernel module ip_vs_wrr with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
W0103 09:41:57.633330       1 proxier.go:477] Failed to load kernel module ip_vs_sh with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
W0103 09:41:57.638341       1 server_others.go:295] Flag proxy-mode="" unknown, assuming iptables proxy
W0103 09:41:57.802455       1 node.go:108] Failed to retrieve node IP: host IP unknown; known addresses: []
I0103 09:41:57.802480       1 server_others.go:148] Using iptables Proxier.
W0103 09:41:57.802597       1 proxier.go:314] invalid nodeIP, initializing kube-proxy with 127.0.0.1 as nodeIP

由于kube-proxy在容器内,所以主要问题是:

W0103 09:41:57.802455       1 node.go:108] Failed to retrieve node IP: host IP unknown; known addresses: []  

e

(已证明版本兼容性不是导致此问题的主要原因)

希望这方面的专家能帮助我。

引用 official 贡献者关于 Kubernetes 版本控制和向后 compatibility/component 偏斜的文档:

...Nodes may lag masters components by up to two minor versions but should be at a version no newer than the master...

所以我想这根本不支持集群设置。

通过查看kubelet日志,终于找到了导致这个问题的根本原因,日志中报了一条路由没有默认路由的警告。手动添加默认路由后,问题解决,一切正常