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
bgpv1: Local internalTrafficPolicy support for ClusterIP advertisements #31442
bgpv1: Local internalTrafficPolicy support for ClusterIP advertisements #31442
Conversation
/test |
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 @chaunceyjiang for taking this up. I don't think change w.r.t calculation of localService endpoints is correct. Please have another look at it.
Also, please add tests with this change.
53d9276
to
f50fc00
Compare
/test |
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.
Looks good, thank you for this change. I would suggest updating the document as well to clarify usage of iTP vs eTP in various service announements.
f50fc00
to
3cf4e15
Compare
74c7fe0
to
2096954
Compare
/test |
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 this work!
Could you please add the context and motivation for the change to the commit log? It's currently difficult to grasp what the commit is about without opening the related PR, which is not particularly user-friendly when looking at the code locally.
I would also recommend splitting the changes into several commits. You have a doc change that is not strictly related to the changes in the code; variables renaming in the tests; code refactoring in svcDesiredRoutes()
; and the addition of the internalTrafficPolicy
support in this code. Each of these could be a separate commit with a relevant description, which would make it much easier to review and to understand in the future.
I also have a few style nits, please see inline below.
2096954
to
78a9110
Compare
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 addressing my feedback on the content 👍.
I stand by my previous comment: splitting the PR into multiple commits remains optional (although recommended), but I really want to see the context and motivation for the change in the commit log before we merge this.
Fixes: cilium#31389 As the ClusterIP services can have .spec.internalTrafficPolicy set to Local, advertising a ClusterIP from a node which has no local endpoints may cause unreachability of the advertised service if the traffic is routed to that node. So if .spec.internalTrafficPolicy of a service is set to Local, advertise its ClusterIP over BGP only if it has non-zero local endpoints. Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Ideally, the internalTrafficPolicy and externalTrafficPolicy fields are independent. However, since we advertise the ClusterIP to the external world via BGP, it has caused some confusion regarding the meanings of external and internal. Therefore, we need to provide some clarification in the documentation. For ClusterIP: Only consider the iTP configuration for advertisement, and ignore the eTP configuration. For ExternalIP and LBIP: Only consider the eTP configuration for advertisement, and ignore the iTP configuration. Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
78a9110
to
eba6b29
Compare
Hi, @qmonnet I've added some context in the commit log, can you take another look? |
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.
I like it much better this way, thanks a lot! 🚀
/test |
/ci-e2e |
Fixes: #31389