-
Notifications
You must be signed in to change notification settings - Fork 471
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
ingress: Add power-of-two-random-choices enhancement #665
ingress: Add power-of-two-random-choices enhancement #665
Conversation
### Goals | ||
|
||
1. Enable cluster administrators to configure HAProxy to use Power of Two Random Choices. | ||
2. Enable application developers configure HAProxy to use Power of Two Random Choices for their Routes. |
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.
2. Enable application developers configure HAProxy to use Power of Two Random Choices for their Routes. | |
2. Enable application developers to configure HAProxy to use Power of Two Random Choices for their Routes. |
|
||
### User Stories | ||
|
||
#### As a cluster administrator, I have an IngressController, it has Routes that update frequently, and I want to traffic to be balanced after a reload. |
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.
#### As a cluster administrator, I have an IngressController, it has Routes that update frequently, and I want to traffic to be balanced after a reload. | |
#### As a cluster administrator, I have an IngressController, it has Routes that update frequently, and I want traffic to be balanced after a reload |
|
||
Using the Power of Two Random Choices may improve balancing in this scenario. | ||
|
||
#### As a cluster administrator, I have a large number of IngressController Pod replicas and a Route with occasional traffic spikes, and I want to ensure that traffic spikes are balanced across the Route's backend servers. |
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.
#### As a cluster administrator, I have a large number of IngressController Pod replicas and a Route with occasional traffic spikes, and I want to ensure that traffic spikes are balanced across the Route's backend servers. | |
#### As a cluster administrator, I have a large number of IngressController Pod replicas and a Route with occasional traffic spikes, and I want to ensure that traffic spikes are balanced across the Route's backend servers |
If the feature gate is enabled, the operator configures the Deployment by | ||
specifying "random" for `ROUTER_LOAD_BALANCE_ALGORITHM`, changing the default | ||
algorithm to Power of Two Random Choices. | ||
|
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.
The router also needs to be changed to allow a random
value for the haproxy.router.openshift.io/balance
route annotation, right?
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.
Yup! Thanks!
3361e30
to
4125062
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: knobunc 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 |
/lgtm |
Add a new feature gate, `PowerOfTwoRandomChoicesBalancing`, that is disabled by default. Enabling this feature gate will tell the OpenShift Router (HAProxy) to use the "Power of Two Random Choices" balancing algorithm by default, in place of the current `leastconn` default balancing algorithm. See https://www.haproxy.com/blog/power-of-two-load-balancing/ as well as openshift/enhancements#665 for more context.
4125062
to
20637b9
Compare
/retest |
/lgtm |
Never mind; wrong PR. |
/lgtm |
This enhancement enables cluster administrators to configure ingress to use the "Power of Two Random Choices" balancing algorithm for more even balancing after router reloads.