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

Azure: Support multiple standard load balancers in one cluster #96111

Merged

Conversation

nilo19
Copy link
Member

@nilo19 nilo19 commented Nov 2, 2020

What type of PR is this?

/kind feature

What this PR does / why we need it:
Currently, only one SLB is allowed per cluster. If users set the mode selection annotation when using the SLB, they would get an error. After this feature implemented, the users could choose if they want a single SLB (current behavior), or they want multiple SLBs, with one SLB binding to one VMAS/VMSS. If the annotation is not set, everything is unchanged: every agent node in the cluster would join the backend pool of the SLB and only one SLB is allowed. If the annotation is set to __auto__ or nodepool1Name,nodepool2Name, there would be a 1: 1 mapping between the SLBs and the VMAS/VMSS. Specifically, for __auto__ mode, the SLB with the minimum load balancing rules would be selected to serve the newly created service; for nodepool1Name,nodepool2Name mode, the SLB of the given VMAS/VMSS with the minimum load balancing rules would be selected. In this way, users could set different outbound rules for different VMAS/VMSS. If there is no SLB of the given VMAS/VMSS, a new SLB would be created.

Which issue(s) this PR fixes:

Fixes kubernetes-sigs/cloud-provider-azure#380

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Support multiple standard load balancers in one cluster

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

https://kubernetes-sigs.github.io/cloud-provider-azure/development/design-docs/multiple-slb/

/sig cloud-provider
/area provider/azure
/priority important-soon
/triage accepted

@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/feature Categorizes issue or PR as related to a new feature. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/provider/azure Issues or PRs related to azure provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 2, 2020
@k8s-ci-robot k8s-ci-robot added area/cloudprovider approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 2, 2020
@feiskyer
Copy link
Member

feiskyer commented Nov 4, 2020

/retest
/milestone v1.20

@k8s-ci-robot k8s-ci-robot added this to the v1.20 milestone Nov 4, 2020
@@ -197,6 +197,12 @@ type Config struct {
// "external": for external LoadBalancer
// "all": for both internal and external LoadBalancer
PreConfiguredBackendPoolLoadBalancerTypes string `json:"preConfiguredBackendPoolLoadBalancerTypes,omitempty" yaml:"preConfiguredBackendPoolLoadBalancerTypes,omitempty"`
// EnableMultipleStandardLoadBalancers determines the behavior of the standard load balancer. If set to true
// there would be one standard load balancer per agent pool, which is similar with the behavior of the basic
Copy link
Member

Choose a reason for hiding this comment

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

s/per agent pool/per VMAS or VMSS/

// there would be one standard load balancer per agent pool, which is similar with the behavior of the basic
// load balancer. Users could select the specific standard load balancer for their service by the service
// annotation `service.beta.kubernetes.io/azure-load-balancer-mode`, If set to false, the standard load balancer
// would keep the current behavior, which is one per cluster. In this case, the mode selection annotation would be ignored.
Copy link
Member

Choose a reason for hiding this comment

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

s/the standard load balancer would keep the current behavior, which is one per cluster/the same standard load balancer would be shared by all services in the cluster/

ProvisioningState: to.StringPtr("Succeeded"),
IPConfigurations: &[]network.InterfaceIPConfiguration{
{
InterfaceIPConfigurationPropertiesFormat: &network.InterfaceIPConfigurationPropertiesFormat{
Copy link
Member

Choose a reason for hiding this comment

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

nit: add a helper function to reduce the duplicated codes

return fmt.Sprintf("%s-%s", prefix, suffix), nil
agentpoolName := strings.Split(prefix, "-")[1]
agentpoolUUID := strings.Split(prefix, "-")[2]
availabilitySetName := fmt.Sprintf("%s-availabilitySet-%s", agentpoolName, agentpoolUUID)
Copy link
Member

Choose a reason for hiding this comment

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

availabilitySetName should be get from VM vm.AvailabilitySet.ID

@nilo19 nilo19 force-pushed the feature/support-multiple-slb branch from b3a4cca to f29efd7 Compare November 5, 2020 05:31
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 5, 2020
@nilo19 nilo19 force-pushed the feature/support-multiple-slb branch from f29efd7 to 667b2be Compare November 5, 2020 06:13
@nilo19
Copy link
Member Author

nilo19 commented Nov 5, 2020

/retest

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 Nov 5, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer, 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

@nilo19
Copy link
Member Author

nilo19 commented Nov 5, 2020

/retest

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. area/cloudprovider area/provider/azure Issues or PRs related to azure provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support multiple Standard LoadBalancer in the same cluster
3 participants