-
Notifications
You must be signed in to change notification settings - Fork 280
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
fix: [multi-slb] Put the service in the load balancer that has no lab… #5281
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nilo19 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 |
c8cbf8f
to
37c5875
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.
/lgtm
thanks for the fixes!
please validate manually as well and unhold after that. /hold |
…el/namespace selector only if there is no other choice for the service.
37c5875
to
cd295b0
Compare
/hold cancel |
@@ -3810,7 +3810,7 @@ func getMostEligibleLBForService( | |||
ruleCount := 301 | |||
if existingLBs != nil { | |||
for _, existingLB := range *existingLBs { | |||
if StringInSlice(pointer.StringDeref(existingLB.Name, ""), eligibleLBs) { | |||
if StringInSlice(trimSuffixIgnoreCase(pointer.StringDeref(existingLB.Name, ""), consts.InternalLoadBalancerNameSuffix), eligibleLBs) { |
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.
We need to ignore the -internal suffix when comparing lb names, or we will ignore all of the internal lbs here.
@desek this would fix the issue. Please take a look. |
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.
/lgtm
/cherrypick release-1.28 |
@nilo19: #5281 failed to apply on top of branch "release-1.28":
In response to this:
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. |
…el/namespace selector only if there is no other choice for the service.
What type of PR is this?
/kind bug
What this PR does / why we need it:
For a load balancer with no label/namespace selectors:
current behavior: it can be a placement targets for services.
new behavior: it can be a placement target for a service if and only if there is no other choice for the service.
Ref: #5261
Which issue(s) this PR fixes:
Fixes #5261
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: