-
Notifications
You must be signed in to change notification settings - Fork 617
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
CCM: Incorrect network interfaces order, when multiple interfaces are used #863
Comments
@ramineni @lingxiankong @adisky I see the following ways to fix the root cause:
|
According to this code https://github.com/kubernetes/kubernetes/blob/16c2ae4607371f1f948c0a9c884805e699330450/pkg/kubelet/nodestatus/setters.go#L76..L91 kubelet won't set the When annotation is set, kube-apiserver still gets updates from CCM, and it just verifies whether an annotated private IP is in the status list: https://github.com/kubernetes/kubernetes/blob/16c2ae4607371f1f948c0a9c884805e699330450/pkg/controller/cloud/node_controller.go#L560..L573 Another interesting behavior. When you set It is possible to modify the updateNodeAddress func and prioritize the IP address, specified in the annotation. This will require code change in kubernetes, which is usually not fast. Modifying gophercloud with the |
Found a way to retrieve IP addresses in a proper order, where no maps are involved: https://docs.openstack.org/api-ref/compute/?expanded=list-port-interfaces-detail#port-interfaces-servers-os-interface |
/kind bug
What happened:
When k8s compute nodes have multiple network interfaces, CCM constantly change them:
This behavior causes issues, when kube-apiserver tries to connect to kubelet for
logs
orexec
command, when10.128.0.0/24
subnet is not available for kube-apiserverAnd loadbalancer pool members change every sync loop:
What you expected to happen:
I expect to see the first interface IP address for all nodes, or at least don't change the IP address orders on every reconciliation loop.
How to reproduce it (as minimally and precisely as possible):
Create VMs with more than one network interfaces.
Anything else we need to know?:
golang/go#27179 golang issue.
Even setting the
alpha.kubernetes.io/provided-node-ip
node annotation or specifying the--node-ip
kubelet parameter doesn't solve the issue.one liner to get the first interface private ip address on the node
ip -o -4 addr show dev $(find /sys/class/net -type l -not -lname '*virtual*' -printf '%f\n' -quit) | cut -d ' ' -f 7 | cut -f 1 -d '/'Just for the history, bugs with slightly similar symptoms:
Environment:
uname -a
):refs:
The text was updated successfully, but these errors were encountered: