-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kube-vip depends on nodename == hostname
for service election, which easily breaks
#810
Comments
Currently kube-vip attempts to handle FQDN hostname cases. For example, here: kube-vip/pkg/manager/watch_endpoints.go Lines 96 to 120 in 0cedf6a
kube-vip/pkg/manager/watch_endpointslices.go Lines 76 to 103 in 0cedf6a
But it still doesn't work because in other places it doesn't:
|
Now that |
Describe the bug
It seems like kube-vip compares
sh -c hostname
to k8s node name when determining on which node a pod is located.This works because k8s automatically assigns node name to
sh -c hostname
.This doesn't work at all in case you alter node name in any way.
Kube-vip shouldn't depend on underlying hostname. Node names should only be compared to other node names.
The solution whould be to use k8s downward API: https://kubernetes.io/docs/concepts/workloads/pods/downward-api/, like suggested in a similar issue: #520 (comment)
To Reproduce
Steps to reproduce the behavior:
sudo kubeadm init --node-name my-custom-node-name
kl taint node my-custom-node-name node-role.kubernetes.io/control-plane:NoSchedule-
kubectl -n kube-system get svc apiserver-lb
curl https://10.3.7.3:6443 --insecure
Expected behavior
External IP is assugned.
Curl is able to connect to the service via the loadbalancer external IP.
Actual behavior
apiserver-lb
gets thekube-vip.io/loadbalancerIPs
annotation but its external IP is forever pending.status.loadBalancer.ingress
is never assigned.curl fails with
Connection timed out
.Environment (please complete the following information):
Kube-vip.yaml
:Additional context
There are a few issues that are likely related to this one:
externalTrafficPolicy: Local
[0.6.2] #608The text was updated successfully, but these errors were encountered: