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

Add support of standard LB to Azure vmss #62707

Merged
merged 4 commits into from
Apr 20, 2018

Conversation

feiskyer
Copy link
Member

What this PR does / why we need it:

Add support of standard LB to Azure vmss.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #60485

Special notes for your reviewer:

Release note:

Add support of standard LB to Azure vmss

/sig azure

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/azure size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 17, 2018
if az.useStandardLoadBalancer() {
return ""
}

Copy link
Contributor

Choose a reason for hiding this comment

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

This will affect EnsureHostsInPool for availabilitySet if standard loadbalancer is on?

Copy link
Member Author

Choose a reason for hiding this comment

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

@karataliu Yep, so availabilitySet logic is also updated here

@feiskyer
Copy link
Member Author

/retest

1 similar comment
@feiskyer
Copy link
Member Author

/retest

standardNodes := []*v1.Node{}

for _, curNode := range nodes {
curScaleSetName, err := extractScaleSetNameByExternalID(curNode.Spec.ExternalID)
Copy link
Contributor

Choose a reason for hiding this comment

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

ExternalID is deprecated and being removed #61877, can we turn to providerId.

Copy link
Member Author

Choose a reason for hiding this comment

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

ack


if instanceIDs.Len() == 0 {
// This may happen when scaling a vmss capacity to 0.
return fmt.Errorf("no nodes running are belonging to vmss %q", ssName)
Copy link
Contributor

Choose a reason for hiding this comment

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

If there're 2 scalesets, do we allow one to be with 0 instances? What about just skip in this case.

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm, makes sense, let's just allow 0 instances.

curScaleSetName, err := extractScaleSetNameByExternalID(curNode.Spec.ExternalID)
if err != nil {
glog.V(4).Infof("Node %q is not belonging to any scale sets, assuming it is belong to availability sets", curNode.Name)
standardNodes = append(standardNodes, curNode)
Copy link
Contributor

Choose a reason for hiding this comment

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

Call excludeMasterNodesFromStandardLB and verify master nodes?
Also what do we do if master node is a scaleset?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will add a check before extractScaleSetNameByExternalID, which would work for both cases

// the same network interface couldn't be added to more than one load balancer of
// the same type. Omit those nodes (e.g. masters) so Azure ARM won't complain
// about this.
backendPool := *newBackendPools[0].ID
Copy link
Contributor

Choose a reason for hiding this comment

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

why not go through all newBackendPools here?

Copy link
Member Author

Choose a reason for hiding this comment

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

We only need to check one because they are in same LB

Copy link
Contributor

Choose a reason for hiding this comment

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

The pools is on path
VMSS -> Properties/NetworkProfile/networkInterfaceConfigurations/IPConfigurations/loadBalancerBackendAddressPools

Thus they can belong to different load balancers, right?

If master VMSS node is there and already with two LBs, the pool could be:

[
{ "id": "/*/Microsoft.Network/loadBalancers/master-internal/backendAddressPools/default" },
{ "id": "/*/Microsoft.Network/loadBalancers/master/backendAddressPools/default"  }
]

If not checking the second one, it may later add this node to another public LB and the call would fail. Please correct me if there's something I missed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. There is also same issue with standard vm codes. Will fix togather in a new commit.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. @karataliu PTAL


for ssName, instanceIDs := range scalesets {
// Only add nodes belonging to specified vmSet to basic LB backends.
if !ss.useStandardLoadBalancer() && ssName != vmSetName {
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to check vmSetName != "" like others? We'd better add a note what does it mean for vmSetName==""

Copy link
Member Author

Choose a reason for hiding this comment

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

vmSetName won't be "" now, see updates here

Copy link
Contributor

Choose a reason for hiding this comment

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

Also use !strings.EqualFold to align with Line438?

Copy link
Member Author

Choose a reason for hiding this comment

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

ACK

@feiskyer
Copy link
Member Author

@karataliu Rebased and addressed comments. PTAL

@karataliu
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 20, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer, karataliu

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-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 62857, 62707). If you want to cherry-pick this change to another branch, please follow the instructions here.

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. 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.

Add support of Azure Standard Load Balancer and Public IP
4 participants