Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
winkernel kube-proxy assumes nodename and hostname are the same #71799
What happened: When using the vsphere cloud provider and a hostname override, kube-proxy does not recognize local endpoints correctly.
What you expected to happen: kube-proxy should use the same logic as kubelet to determine nodename. The nodename does not need to be the same as the hostname override.
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
This is the line where proxier compares a nodename in an endpoint to the hostname:
The hostname used by proxier above is determined by kube-proxy here:
This will use the hostname-override if provided, and the os' hostname otherwise. This hostname is used to create the proxier, a healthz check, and the NodeRef in the ProxyServer struct. I believe that the other two uses actually want a hostname (an IP or something DNS-routeable).
kubelet determines the nodename:
I think kube-proxy should use the same cloud-provider function to determine the nodename, since the important thing about this value is it matched what kubelet is using when registering the node.
This also applies to other proxiers (the ones on linux):