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

fix: [multi-slb] Put the service in the load balancer that has no lab… #5281

Merged
merged 1 commit into from Jan 16, 2024

Conversation

nilo19
Copy link
Contributor

@nilo19 nilo19 commented Jan 12, 2024

…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?

fix: [multi-slb] Put the service in the load balancer that has no label/namespace selector only if there is no other choice for the service.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 12, 2024
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 12, 2024
Copy link
Member

@feiskyer feiskyer left a 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!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 15, 2024
@feiskyer
Copy link
Member

please validate manually as well and unhold after that.

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 15, 2024
…el/namespace selector only if there is no other choice for the service.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 15, 2024
@nilo19
Copy link
Contributor Author

nilo19 commented Jan 15, 2024

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 15, 2024
@@ -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) {
Copy link
Contributor Author

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.

@nilo19
Copy link
Contributor Author

nilo19 commented Jan 15, 2024

@desek this would fix the issue. Please take a look.

Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 16, 2024
@k8s-ci-robot k8s-ci-robot merged commit 1ea6564 into kubernetes-sigs:master Jan 16, 2024
18 checks passed
@nilo19 nilo19 deleted the fix/lb-selector branch January 16, 2024 00:29
@nilo19
Copy link
Contributor Author

nilo19 commented Jan 16, 2024

/cherrypick release-1.28

@k8s-infra-cherrypick-robot

@nilo19: #5281 failed to apply on top of branch "release-1.28":

Applying: fix: [multi-slb] Put the service in the load balancer that has no label/namespace selector only if there is no other choice for the service.
Using index info to reconstruct a base tree...
M	hack/deploy-cluster-capz.sh
M	pkg/provider/azure.go
M	pkg/provider/azure_loadbalancer.go
M	pkg/provider/azure_loadbalancer_repo.go
M	pkg/provider/azure_loadbalancer_test.go
M	pkg/provider/azure_standard.go
M	pkg/provider/azure_utils.go
M	tests/e2e/network/multiple_standard_lb.go
M	tests/k8s-azure/manifest/cluster-api/vmss-multi-nodepool.yaml
Falling back to patching base and 3-way merge...
Auto-merging tests/k8s-azure/manifest/cluster-api/vmss-multi-nodepool.yaml
CONFLICT (content): Merge conflict in tests/k8s-azure/manifest/cluster-api/vmss-multi-nodepool.yaml
Auto-merging tests/e2e/network/multiple_standard_lb.go
CONFLICT (content): Merge conflict in tests/e2e/network/multiple_standard_lb.go
Auto-merging pkg/provider/azure_utils.go
Auto-merging pkg/provider/azure_standard.go
Auto-merging pkg/provider/azure_loadbalancer_test.go
CONFLICT (content): Merge conflict in pkg/provider/azure_loadbalancer_test.go
Auto-merging pkg/provider/azure_loadbalancer_repo.go
Auto-merging pkg/provider/azure_loadbalancer.go
Auto-merging pkg/provider/azure.go
Auto-merging hack/deploy-cluster-capz.sh
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 fix: [multi-slb] Put the service in the load balancer that has no label/namespace selector only if there is no other choice for the service.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-1.28

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple Standard LoadBalancers doesn't respect ServiceLabelSelector
4 participants