Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

fix: Windows + VMSS external svc routing broken #1028

Merged
merged 5 commits into from Apr 15, 2019

Conversation

adelina-t
Copy link
Contributor

The VMSSs for Linux and Windows agentpools follow a different
naming patterns. However, when populating azure.json, aks-engine
does not take that into account and we end up with the wrong name
for the primareyScaleSetName variable. Thus, the LB created for
service will have a empty backend pool, as there isn't a
VMSS with the desired name.

Properly populating the ARM variable for the primaryScaleSet will
fix this issue.

Fixes: #809

Reason for Change:

Issue Fixed:

Requirements:

Notes:

@acs-bot acs-bot added size/L and removed size/XS labels Apr 11, 2019
@CecileRobertMichon CecileRobertMichon changed the title Fix "Windows + VMSS external svc routing broken" fix: Windows + VMSS external svc routing broken Apr 11, 2019
@CecileRobertMichon
Copy link
Contributor

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@CecileRobertMichon
Copy link
Contributor

@adelina-t the unit tests failed on the lint step.

@adelina-t
Copy link
Contributor Author

Will check. Thank you!

@jackfrancis
Copy link
Member

These test failures are real, looking into them

@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

adelina-t and others added 3 commits April 11, 2019 14:16
The VMSSs for Linux and Windows agentpools follow a different
naming patterns. However, when populating azure.json, aks-engine
does not take that into account and we end up with the wrong name
for the primareyScaleSetName variable. Thus, the LB created for
service will have a empty backend pool, as there isn't a
VMSS with the desired name.

Properly populating the ARM variable for the primaryScaleSet will
fix this issue.

Fixes: Azure#809
@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@acs-bot acs-bot added size/M and removed size/L labels Apr 11, 2019
@@ -898,12 +898,22 @@ func (p *Properties) GetNSGName() string {

// GetPrimaryAvailabilitySetName returns the name of the primary availability set of the cluster
func (p *Properties) GetPrimaryAvailabilitySetName() string {
Copy link
Member

Choose a reason for hiding this comment

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

@xizhamsft this method is called to populate AKS metadata for the cluster record. It doesn't make sense that we'd have a static value for PrimaryAvailabilitySetName when there is no AvailabilitySet in the cluster. Does changing this method to return an empty string have any breaking effects on the AKS VMSS scenario?

masterVars["vmType"] = "standard"
}
masterVars["primaryScaleSetName"] = cs.Properties.GetPrimaryScaleSetName()
Copy link
Member

Choose a reason for hiding this comment

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

We can just set this variable using the getter now that the getter returns an empty string if the primary agent pool is not vmss.

@@ -124,7 +124,7 @@ func TestK8sVars(t *testing.T) {
"nsgName": "[concat(variables('masterVMNamePrefix'), 'nsg')]",
"orchestratorNameVersionTag": "Kubernetes:" + testK8sVersion,
"primaryAvailabilitySetName": "",
"primaryScaleSetName": "[concat(parameters('orchestratorName'), '-agentpool1-',parameters('nameSuffix'), '-vmss')]",
"primaryScaleSetName": cs.Properties.GetPrimaryScaleSetName(),
Copy link
Member

Choose a reason for hiding this comment

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

This is the actual fix.

Copy link
Member

Choose a reason for hiding this comment

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

In other words, we're validating that the value of the ARM variable primaryScaleSetName derives from the canonical primaryScaleSetName() method, not from an ARM expression string.

@@ -968,12 +968,6 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat
"GetMasterEtcdClientPort": func() int {
return DefaultMasterEtcdClientPort
},
"GetPrimaryAvailabilitySetName": func() string {
Copy link
Member

Choose a reason for hiding this comment

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

These template layer functions are never called.

@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codecov
Copy link

codecov bot commented Apr 12, 2019

Codecov Report

Merging #1028 into master will increase coverage by 0.06%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1028      +/-   ##
==========================================
+ Coverage   74.51%   74.57%   +0.06%     
==========================================
  Files         131      131              
  Lines       17963    17969       +6     
==========================================
+ Hits        13385    13401      +16     
+ Misses       3829     3820       -9     
+ Partials      749      748       -1

@jackfrancis
Copy link
Member

/lgtm

@acs-bot
Copy link

acs-bot commented Apr 15, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adelina-t, jackfrancis

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

@acs-bot acs-bot merged commit 31fc8ab into Azure:master Apr 15, 2019
jackfrancis pushed a commit to jackfrancis/aks-engine that referenced this pull request Apr 23, 2019
* fix: "Windows + VMSS external svc routing broken"

The VMSSs for Linux and Windows agentpools follow a different
naming patterns. However, when populating azure.json, aks-engine
does not take that into account and we end up with the wrong name
for the primareyScaleSetName variable. Thus, the LB created for
service will have a empty backend pool, as there isn't a
VMSS with the desired name.

Properly populating the ARM variable for the primaryScaleSet will
fix this issue.

Fixes: Azure#809

* chore: fix unit tests, protect against nil dereference

* chore: more tests, get rid of dead code, rationalize GetPrimaryAvailabilitySetName

* chore: lint

* test: fix unit tests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows + VMSS external svc routing broken
4 participants