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 Azure SLB support for multiple backend pools #76691

Merged
merged 1 commit into from Apr 18, 2019

Conversation

@feiskyer
Copy link
Member

commented Apr 17, 2019

Azure VM and vmssVM support multiple backend pools for the same SLB, but
not for different LBs.

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

SLB backend pools are empty if outbound rules are defined in a separate backend pool.

This is because, although we added the check for not adding the backend pools from different LBs, the lbName is not checked.

This PR fixes the issue by also checking the LB name.

Which issue(s) this PR fixes:

Fixes #76687

Special notes for your reviewer:

Should cherry pick to old releases.

Does this PR introduce a user-facing change?:

Ensure the backend pools are set correctly for Azure SLB with multiple backend pools (e.g. outbound rules)

/kind bug
/sig azure
/priority critial-urgent

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Apr 17, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer

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

@feiskyer

This comment has been minimized.

Copy link
Member Author

commented Apr 17, 2019

/priority critical-urgent
/assign @andyzhangx @khenidak

@feiskyer feiskyer added this to In progress in Provider Azure via automation Apr 17, 2019

@feiskyer

This comment has been minimized.

Copy link
Member Author

commented Apr 17, 2019

/test pull-kubernetes-e2e-aks-engine-azure

@feiskyer feiskyer moved this from In progress to Needs Review in Provider Azure Apr 17, 2019

@feiskyer

This comment has been minimized.

Copy link
Member Author

commented Apr 17, 2019

/retest

@andyzhangx
Copy link
Member

left a comment

is it possible to combine the code change (use a standalone function?) under vmas and vmss, it's quite similar:

			newBackendPoolsIDs := make([]string, 0, len(newBackendPools))
			for _, pool := range newBackendPools {				for _, pool := range newBackendPools {
				backendPool := *pool.ID					if pool.ID != nil {
				matches := backendPoolIDRE.FindStringSubmatch(backendPool)						newBackendPoolsIDs = append(newBackendPoolsIDs, *pool.ID)
				if len(matches) == 2 {	
					lbName := matches[1]	
					if strings.HasSuffix(lbName, InternalLoadBalancerNameSuffix) == isInternal {	
						klog.V(4).Infof("Node %q has already been added to LB %q, omit adding it to a new one", nodeName, lbName)	
						return nil	
					}	
				}					}
			}				}
			isSameLB, oldLBName, err := isBackendPoolOnSameLB(backendPoolID, newBackendPoolsIDs)
			if err != nil {
				return err
			}
			if !isSameLB {
				klog.V(4).Infof("Node %q has already been added to LB %q, omit adding it to a new one", nodeName, oldLBName)
				return nil
			}
@feiskyer

This comment has been minimized.

Copy link
Member Author

commented Apr 17, 2019

is it possible to combine the code change (use a standalone function?) under vmas and vmss, it's quite similar

that's already done in func isBackendPoolOnSameLB(). The other parts couldn't be combined because of different data struct.

@feiskyer feiskyer force-pushed the feiskyer:slb-multi-backendpool branch from 68a7761 to ed4d720 Apr 17, 2019

@feiskyer

This comment has been minimized.

Copy link
Member Author

commented Apr 17, 2019

@andyzhangx Addressed comments. PTAL

@feiskyer

This comment has been minimized.

Copy link
Member Author

commented Apr 17, 2019

/retest

Fix Azure SLB support for multiple backend pools
Azure VM and vmssVM support multiple backend pools for the same SLB, but
not for different LBs.

@feiskyer feiskyer force-pushed the feiskyer:slb-multi-backendpool branch from ed4d720 to ef6f88d Apr 18, 2019

@k8s-ci-robot k8s-ci-robot added the lgtm label Apr 18, 2019

@andyzhangx
Copy link
Member

left a comment

/lgtm

@k8s-ci-robot k8s-ci-robot merged commit 8f09fd6 into kubernetes:master Apr 18, 2019

20 checks passed

cla/linuxfoundation feiskyer authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details

Provider Azure automation moved this from Needs Review to Done Apr 18, 2019

@feiskyer feiskyer deleted the feiskyer:slb-multi-backendpool branch Apr 18, 2019

k8s-ci-robot added a commit that referenced this pull request Apr 19, 2019
Merge pull request #76758 from feiskyer/automated-cherry-pick-of-#766…
…91-upstream-release-1.12

Automated cherry pick of #76691: Fix Azure SLB support for multiple backend pools
k8s-ci-robot added a commit that referenced this pull request Apr 23, 2019
Merge pull request #76759 from feiskyer/automated-cherry-pick-of-#766…
…91-upstream-release-1.11

Automated cherry pick of #76691: Fix Azure SLB support for multiple backend pools
k8s-ci-robot added a commit that referenced this pull request Apr 26, 2019
Merge pull request #76754 from feiskyer/automated-cherry-pick-of-#766…
…91-upstream-release-1.13

Automated cherry pick of #76691: Fix Azure SLB support for multiple backend pools
k8s-ci-robot added a commit that referenced this pull request May 1, 2019
Merge pull request #76753 from feiskyer/automated-cherry-pick-of-#766…
…91-upstream-release-1.14

Automated cherry pick of #76691: Fix Azure SLB support for multiple backend pools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.