-
Notifications
You must be signed in to change notification settings - Fork 326
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
[sync-catalog] Fix NodePort register service with wrong internal IP when multiple internal IPs are reported on the node #619
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Looks good, just one suggestion for comments.
@lkysow thanks for reviewing the PR! I've merged in your suggestion, squashed the commit and rebased master. |
Hi @lkysow, is it possible to backport this change to 0.25, 0.26, 0.33 because we are using
Looks like consul-k8s upgraded to consul 1.10 in 0.34 |
Hi @kolorful are you not able to upgrade to consul 1.10 and consul-k8s latest? Or is there an issue with those versions together? |
Hi @lkysow we plan to, but it would take some time before we can get there. If back-port is as easy as running a script for you, it would be really appreciated so we don't need to maintain a fork for the time being. Thank you :) |
Ahh I see. We actually don't do any backport releases of consul-k8s right now so it's unfortunately not as easy as running a script. |
I see, that's fine, thank you! |
This PR fixed an issue where consul-sync will register NodePort services with wrong internal IPs when multiple internal IPs are reported on the node, and this is a common pattern when using the AWS CNI plugin.
When using the AWS CNI plugin, multiple ENIs could be used and the secondary ENI with multiple IPs are not used by the node itself, but assigned to individual pods. In this case kubelet will end up reporting all used IPs on all ENIs as internal IPs on the node. (Detailed explanation)
Kubernetes has since made sure the first IP would be equal to the IP on eth0 (reference 2) and it would be the actual IP of the Node.
Prior to my fix the consul-sync program always sync the last matching IP to consul and it ends up being a Pod IP on that node. This PR fixed it by always picking the first matching IP as how Kubernetes is implemented.
Changes proposed in this PR:
How I've tested this PR:
How I expect reviewers to test this PR:
Checklist: