-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
Fix Azure SLB support for multiple backend pools #76691
Conversation
[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 |
/priority critical-urgent |
/test pull-kubernetes-e2e-aks-engine-azure |
/retest |
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.
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
}
that's already done in func |
68a7761
to
ed4d720
Compare
@andyzhangx Addressed comments. PTAL |
/retest |
Azure VM and vmssVM support multiple backend pools for the same SLB, but not for different LBs.
ed4d720
to
ef6f88d
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
…91-upstream-release-1.12 Automated cherry pick of #76691: Fix Azure SLB support for multiple backend pools
…91-upstream-release-1.11 Automated cherry pick of #76691: Fix Azure SLB support for multiple backend pools
…91-upstream-release-1.13 Automated cherry pick of #76691: Fix Azure SLB support for multiple backend pools
…91-upstream-release-1.14 Automated cherry pick of #76691: 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.
What type of PR is this?
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?:
/kind bug
/sig azure
/priority critial-urgent