Skip to content

feat(loadbalancer): Add LoadBalancerType Client Side Weighted Round Robin#7407

Merged
jukie merged 39 commits intoenvoyproxy:mainfrom
altaiezior:client-wrr
Mar 23, 2026
Merged

feat(loadbalancer): Add LoadBalancerType Client Side Weighted Round Robin#7407
jukie merged 39 commits intoenvoyproxy:mainfrom
altaiezior:client-wrr

Conversation

@altaiezior
Copy link
Contributor

@altaiezior altaiezior commented Nov 2, 2025

What type of PR is this?

What this PR does / why we need it:
This PR provides addition of new load balancer type client side weighted round robin. This is a new load balancing extension introduced since envoy 1.32

https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.proto

Which issue(s) this PR fixes:

Fixes #7305

Release Notes: Yes

@altaiezior altaiezior requested a review from a team as a code owner November 2, 2025 03:31
@altaiezior
Copy link
Contributor Author

@jukie I have added the implementation and also tested it on my local setup

PS: the repo is so easy to contribute everything just works with the docs given on the site :)

@altaiezior
Copy link
Contributor Author

Also I wanted to know should I include slow start in client wrr?

So the thing is that I have submitted the proposal in grpc-xds grpc/proposal#498 and also in envoy I have got the proto updated.

It is not implemented yet, but I am trying to pick it up this month if my time allows

@altaiezior
Copy link
Contributor Author

altaiezior commented Nov 2, 2025

Also I am unsure of how to test this e2e, so I have just included an AI generated e2e test suite.

The challenge here is that we need multiple replicas with each server respond with a specific header containing rps and cpu_utilisation and then the traffic is distributed by calculating the weight (rps / cpu)

I don't know what the current e2e tests allow and if this type of test case is feasible to write

@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

❌ Patch coverage is 68.53933% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.32%. Comparing base (1005160) to head (b570798).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/xds/translator/cluster.go 58.53% 16 Missing and 1 partial ⚠️
internal/gatewayapi/clustersettings.go 75.00% 4 Missing and 4 partials ⚠️
internal/gatewayapi/backendtrafficpolicy.go 75.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7407      +/-   ##
==========================================
- Coverage   74.34%   74.32%   -0.03%     
==========================================
  Files         242      242              
  Lines       37707    37793      +86     
==========================================
+ Hits        28035    28089      +54     
- Misses       7730     7754      +24     
- Partials     1942     1950       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@altaiezior
Copy link
Contributor Author

altaiezior commented Nov 4, 2025

Also I wanted to know should I include slow start in client wrr?

So the thing is that I have submitted the proposal in grpc-xds grpc/proposal#498 and also in envoy I have got the proto updated.

It is not implemented yet, but I am trying to pick it up this month if my time allows

I have started the implementation of slow_start_config and locality lb config with WRR as well, if possible I would also want to include them in the gatway implementation.

envoyproxy/envoy#41841

@jukie
Copy link
Contributor

jukie commented Nov 13, 2025

We wait to add features here until they've made it into a full envoy release. The flow would be getting this lb support added for 1.7 and if your envoy changes get merged we can add that support to gateway in 1.8.

Let's keep the scope of this PR to what's currently available and we can always include additional features in a follow-up. Are you able to make the suggested changes or can you join the contributors call next week to discuss?

@altaiezior
Copy link
Contributor Author

Sure, I just paused because the other changes were also approved, but I understand I will make the respective changes as suggested. Will try to complete them by today / tomorrow @jukie

@altaiezior
Copy link
Contributor Author

@jukie I have made the respective changes

anurag.ag added 6 commits November 17, 2025 05:48
…Gateway CRDs, ensuring configurable parameters and validation rules are integrated. Includes e2e test for validation.

Signed-off-by: anurag.ag <anuragagarwal561994@users.noreply.github.com>
Signed-off-by: anurag.ag <anuragagarwal561994@users.noreply.github.com>
Signed-off-by: anurag.ag <anuragagarwal561994@users.noreply.github.com>
…eway CRDs and related configurations. Update associated test data and documentation.

Signed-off-by: anurag.ag <anuragagarwal561994@users.noreply.github.com>
…entSideWeightedRoundRobin configuration, update affected tests and CRDs.

Signed-off-by: anurag.ag <anuragagarwal561994@users.noreply.github.com>
…cross Gateway CRDs, configuration files, and related tests. Adjust documentation to reflect percentage-based representation.

Signed-off-by: anurag.ag <anuragagarwal561994@users.noreply.github.com>
@jukie
Copy link
Contributor

jukie commented Nov 27, 2025

Overall looks good, just a few more comments @anuragagarwal561994! Thanks for adding this and make sure to run gen-check before pushing.

Sorry for the delayed review on this. I'll prioritize helping you with this next week.

@altaiezior
Copy link
Contributor Author

@jukie I will be able to pick up these changes only by next week as I am travelling and been catching up with my work lately.

@jukie
Copy link
Contributor

jukie commented Mar 18, 2026

@altaiezior do you still plan on updating this?

@altaiezior
Copy link
Contributor Author

@jukie I want to but the conflicts are a bit much and I am currently caught up with my work, so I will need more time to look into this.

@altaiezior
Copy link
Contributor Author

altaiezior commented Mar 20, 2026

@jukie I have re-merged master now with this branch, most of the merge-conflicts I have resolved with the help of AI and reviewed it once on my own.

@altaiezior
Copy link
Contributor Author

@jukie do I need to make some changes here?

@jukie
Copy link
Contributor

jukie commented Mar 21, 2026

@altaiezior just a few nits left. I'd really like to see this make it into 1.8 and will make it a priority to review if you're able to add the changes.

@jukie jukie requested review from arkodg, jukie and zirain March 21, 2026 12:37
…balancer_types.go` for consistency.

Signed-off-by: altaiezior <6075379+altaiezior@users.noreply.github.com>
…zation load balancers. Adjust tests to reflect the new validation rule.

Signed-off-by: altaiezior <6075379+altaiezior@users.noreply.github.com>
…lization` fields (`BlackoutPeriod`, `WeightExpirationPeriod`, `WeightUpdatePeriod`).

Signed-off-by: altaiezior <6075379+altaiezior@users.noreply.github.com>
…ion` handling within cluster translator.

Signed-off-by: altaiezior <6075379+altaiezior@users.noreply.github.com>
…ackendTrafficPolicy.

Signed-off-by: altaiezior <6075379+altaiezior@users.noreply.github.com>
arkodg
arkodg previously approved these changes Mar 23, 2026
jukie
jukie previously approved these changes Mar 23, 2026
Signed-off-by: Isaac Wilson <isaac.wilson514@gmail.com>
@jukie jukie dismissed stale reviews from arkodg and themself via b570798 March 23, 2026 09:02
@jukie jukie merged commit ef8f744 into envoyproxy:main Mar 23, 2026
58 of 62 checks passed
@altaiezior altaiezior deleted the client-wrr branch March 23, 2026 11:56
@altaiezior
Copy link
Contributor Author

Yey :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Client Load Balancing Weighted Round Robin

5 participants