简体   繁体   English

kube-proxy报告错误的IP地址

[英]kube-proxy reports wrong ip address

In my kubernetes cluster, each node is a virtualbox vm with two NICs, eth0 for NAT and eth1 for Host-Local communicating. 在我的kubernetes集群中,每个节点都是一个具有两个NIC的virtualbox虚拟机,其中eth0用于NAT,而eth1用于主机-本地通信。

kubectl get pod --all-namespaces -o wide shows kubectl get pod --all-namespaces -o wide显示

在此处输入图片说明

We can see k8s-3 and k8s-4 reports correct IPs while k8s-2 doesn't. 我们可以看到k8s-3和k8s-4报告正确的IP,而k8s-2没有。

I've tried to add --bind-address=192.168.99.202 in k8s-2 's kube-proxy.yaml but it just don't work. 我试图在k8s-2kube-proxy.yaml添加--bind-address=192.168.99.202 ,但这只是不起作用。

Anyone has any advice? 有人有什么建议吗?

use --hostname-override in your kubelet and set it to the ip. 在您的kubelet中使用--hostname-override并将其设置为ip。 it will make your name of your node into your ip but it will have the correct address. 它将使您的节点名称成为您的IP,但它将具有正确的地址。 i had this problem on my test cluster (vagrant and virtualbox) and i had to make that change. 我在测试群集(无用和virtualbox)上遇到了这个问题,我不得不进行更改。 I also set the hostname-overide in my kube-proxy. 我还在kube-proxy中设置了hostname-overide。 i was troubleshooting issues with my kube-proxy and at one point i made that change but thats not what ultimately resolved it so i am unsure if really needed. 我正在使用kube-proxy排除故障,有一次我进行了更改,但这并不是最终解决问题的方法,因此我不确定是否确实需要。

if your running flannel, don't forget to make sure its using the correct --iface since it likes to use eth0. 如果您正在运行法兰绒,请不要忘记确保使用正确的--iface,因为它喜欢使用eth0。

https://github.com/kubernetes/kubernetes/issues/44702 https://github.com/kubernetes/kubernetes/issues/44702

Problem solved by passing --node-ip= to kubelet. 通过将--node-ip=传递给kubelet解决了问题。

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

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