-
Notifications
You must be signed in to change notification settings - Fork 53
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
udproute: add support for round-robin load balancing #117
Conversation
53583f8
to
27f86b6
Compare
27f86b6
to
916819e
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.
This is looking really good, thank you for taking the time to knock this one out @aryan9600!
This review was my first pass that you, @astoycos and myself jumped on a Zoom for, and most of these comments are related to follow ups e.t.c.
We'll want to make sure we get review from Andrew as well:
/cc @astoycos
|
||
ip := net.ParseIP(addr.IP) | ||
|
||
podip := binary.BigEndian.Uint32(ip.To4()) |
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.
There's a couple places where we implicitly assume V4, this is totally fine for now, but if we don't have an issue tracking adding V6 support we should create that.
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.
ea15f25
to
062cb70
Compare
Add support for round-robin load balancing for UDPRoute. This enables mutliple backend references in a UDPRoute object, with traffic being distributed to each backend in a round-robin fashion. A new BPF map `GATEWAY_INDEXES` was introduced to help keep track of the "last active" backend, to help determine the backend for the next UDP packet. Signed-off-by: Sanskar Jaiswal <[email protected]>
Avoid fetching Endpoints while deleting the Targets in the dataplane, since we only need the Gateway's IP addr and port for such an action. This avoids potential errors that can arise due to an Endpoint being deleted before the reconciler reacts to a UDPRoute/TCPRoute's deletion, which can block the object from being garbage collected forever due to the presence of finalizers. Signed-off-by: Sanskar Jaiswal <[email protected]>
Signed-off-by: Sanskar Jaiswal <[email protected]>
062cb70
to
41b1d80
Compare
/lgtm Had a good zoom review I think this a really good start on complete round-robin support for UDP and TC thanks @aryan9600 !!! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aryan9600, astoycos The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add support for distributing traffic amongst several backends for a UDPRoute in a round-robin fashion. High level changes:
target
field in theTargets
protobuf message has been updated to be a list namedtargets
.BACKENDS
has been updated to be of type<BackendKey, BackendList>
, whereBackendList
contains a list ofBackends
.GATEWAY_INDEXES
of type<BackendKey, u16>
has been introduced to keep track of the last backend that received a packet.Deletion handling for TCPRoute and UDPRoute has also been improved by avoiding fetching related
Endpoints
, which could lead to objects being stuck with finalizers.Fixes #10