Skip to content
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

General: use client-side round-robin load balancing for grpc #5225

Merged
merged 3 commits into from
Dec 8, 2023

Conversation

BojanZelic
Copy link
Contributor

@BojanZelic BojanZelic commented Nov 28, 2023

Use Client-side grpc round-robin load balancing to better spread the load when using the external scaler;

Scenario A:
keda operator makes a grpc call to a Service with a clusterIP. There's only 1 clusterIP. This PR won't affect this setup. Load balancing (within k8s/iptables) only happens when new connections or a connection failure. Requests are hitting the same underlying pod; Users should migrate to headless service.

Scenario B:
Keda operator makes a grpc call to a headless service & DNS randomizes the pod IP order. load balancing happens whenever there's a connection failure or if the server set a MaxConnectionAge, otherwise 1 pod is going to be receiving the all of the load. This PR fixes this

Scenario C:
Keda operator makes a grpc call to a headless service & DNS doesn't randomize the pod IP order. load balancing currently never happens, 1 pod will be receiving all the load. This PR fixes this.

Checklist

Fixes # #5224

@BojanZelic BojanZelic requested a review from a team as a code owner November 28, 2023 19:28
Copy link

Thank you for your contribution! 🙏 We will review your PR as soon as possible.

While you are waiting, make sure to:

Learn more about:

@JorTurFer
Copy link
Member

JorTurFer commented Nov 28, 2023

/run-e2e
Update: You can check the progress here

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM but I have a really poor knowledge about gRPC
WDYT @zroubalik ?

pkg/metricsservice/client.go Outdated Show resolved Hide resolved
@JorTurFer
Copy link
Member

JorTurFer commented Nov 28, 2023

/run-e2e
Update: You can check the progress here

@BojanZelic-DD
Copy link

The E2E test failure seems unrelated? Seems like it failed on the cleanup steps

@JorTurFer
Copy link
Member

The E2E test failure seems unrelated? Seems like it failed on the cleanup steps

e2e tests are unstable right now, I'm working on a PR to fix it, once the fix is merged I'll trigger e2e test again here

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zroubalik
Copy link
Member

@BojanZelic please rebase and resolve conflicts, let's merge this if e2e pass then. Thanks!

Signed-off-by: Bojan Zelic <bnzelic@gmail.com>
Signed-off-by: Bojan Zelic <bnzelic@gmail.com>
Signed-off-by: Bojan Zelic <bnzelic@gmail.com>
@BojanZelic BojanZelic force-pushed the client-side-grpc-load-balancing branch from 5dd293a to c4387da Compare December 7, 2023 19:00
@zroubalik
Copy link
Member

zroubalik commented Dec 7, 2023

/run-e2e
Update: You can check the progress here

@zroubalik zroubalik merged commit 19f14a8 into kedacore:main Dec 8, 2023
19 checks passed
@BojanZelic BojanZelic deleted the client-side-grpc-load-balancing branch December 8, 2023 14:19
toniiiik pushed a commit to toniiiik/keda that referenced this pull request Jan 15, 2024
…e#5225)

Signed-off-by: Bojan Zelic <bnzelic@gmail.com>
Signed-off-by: anton.lysina <alysina@gmail.com>
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.

4 participants