-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
support 2 tier control over sticky_persistent sessions #10627
base: main
Are you sure you want to change the base?
support 2 tier control over sticky_persistent sessions #10627
Conversation
Signed-off-by: Travis Glenn Hansen <[email protected]>
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Welcome @travisghansen! |
Hi @travisghansen. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: travisghansen The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Travis Glenn Hansen <[email protected]>
What this PR does / why we need it:
Better control over the balancing logic of
sticky_persistent
when clients do not have a valid cookie value (or don't support cookies for whatever reason) by replacing the currently random selection. I've implemented the ability to control the 2nd tier of balancing by using theload-balance
annotation to select any of the existing balancers (excluding thesticky_*
balancers to prevent infinite loops).If
load-balance
annotation is not present in an otherwisesticky_persistent
configuration the new features are entirely ignored and will simply fallback to the existingreturn self.instance:random_except(failed_upstreams)
.Our particular use-case is to replace an existing F5 config using k8s+ingress-nginx which selects the 2nd tier by client IP. This PR solves that use-case generically by effectively allowing any of the existing balancers to be leveraged as the 2nd tier.
Some examples:
Types of changes
Which issue/s this PR fixes
How Has This Been Tested?
Tested with an on-prem cluster using metallb with
externalTrafficPolicy
set toLocal
to ensure consistent client IP ($remote_addr
). I have removed various debugging statements but had them spread everywhere to test the various logic flows. Beyond testing the pin-by-IP logic I also testedround_robin
andewma
as secondary balancers as well. On the surface all seems sane at this point.Checklist: