-
Notifications
You must be signed in to change notification settings - Fork 560
Conversation
2916c7a
to
dd607f0
Compare
We should wait a while for kubernetes/enhancements#586, so as to support zoned AzureDisks as well. |
@aheumaier: @ritazh is working on this PR currently |
79143b1
to
6294350
Compare
6294350
to
3804e7e
Compare
Codecov Report
@@ Coverage Diff @@
## master #3453 +/- ##
==========================================
+ Coverage 55.41% 55.46% +0.04%
==========================================
Files 108 108
Lines 16102 16146 +44
==========================================
+ Hits 8923 8955 +32
- Misses 6416 6425 +9
- Partials 763 766 +3 |
3804e7e
to
fb067f7
Compare
9cdb28e
to
b95ef71
Compare
pkg/api/vlabs/validate.go
Outdated
if a.AgentPoolProfiles[i].Count < len(a.AgentPoolProfiles[i].AvailabilityZones)*2 { | ||
return errors.New("The node count and the number of availability zones provided can result in zone imbalance. To achieve zone balance, each zone should have at least 2 nodes or more. ") | ||
} | ||
} |
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.
can we add a validation for singlePlacementGroups for VMSS only?
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.
done
@@ -38,6 +41,11 @@ | |||
"name": "[variables('{{.Name}}VMSize')]" | |||
}, | |||
"properties": { | |||
{{if UseSinglePlacementGroup .}} | |||
"singlePlacementGroup": true, |
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.
This could be:
"singlePlacementGroup": {{UseSinglePlacementGroup .}} ,
@@ -38,6 +41,11 @@ | |||
"name": "[variables('{{.Name}}VMSize')]" | |||
}, | |||
"properties": { | |||
{{if UseSinglePlacementGroup .}} | |||
"singlePlacementGroup": true, |
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.
ditto
pkg/acsengine/defaults.go
Outdated
@@ -555,6 +556,33 @@ func setMasterNetworkDefaults(a *api.Properties, isUpgrade bool) { | |||
} | |||
} | |||
|
|||
// setVMSSDefaults | |||
// singlePlacementGroup = false, the scale set can be composed of multiple placement groups and has a range of 0-1,000 VMs | |||
// singlePlacementGroup = true,, default value, a scale set is composed of a single placement group, and has a range of 0-100 VMs |
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.
extra ,
here
pkg/acsengine/defaults.go
Outdated
// singlePlacementGroup = true,, default value, a scale set is composed of a single placement group, and has a range of 0-100 VMs | ||
// Large scale sets require Azure Managed Disks. | ||
// https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-placement-groups | ||
// For availability zones, only standard load balancer is supported. |
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.
these comments should be added to the docs instead (https://github.com/Azure/acs-engine/blob/master/docs/clusterdefinition.md)
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
62955e6
to
e6df391
Compare
New changes are detected. LGTM label has been removed. |
d334eef
to
f3f8bd2
Compare
f3f8bd2
to
4bfd386
Compare
rebased, jenkins e2e passed. ready for another round of review |
pkg/acsengine/defaults.go
Outdated
a.OrchestratorProfile.KubernetesConfig.LoadBalancerSku = "Standard" | ||
a.OrchestratorProfile.KubernetesConfig.ExcludeMasterFromStandardLB = helpers.PointerToBool(api.DefaultExcludeMasterFromStandardLB) | ||
} | ||
if profile.SinglePlacementGroup == nil { |
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.
This should move up to be above line 570, so that if we ever change DefaultSinglePlacementGroup
to false we get the foo in the if false set to managed disk thing.
pkg/acsengine/template_generator.go
Outdated
return *profile.SinglePlacementGroup | ||
}, | ||
"HasAvailabilityZones": func(profile *api.AgentPoolProfile) bool { | ||
return profile.AvailabilityZones != nil && len(profile.AvailabilityZones) > 0 |
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.
Let's create a convenience function hasAvailabilityZones
that this templat func calls...
pkg/acsengine/params.go
Outdated
@@ -173,6 +173,9 @@ func getParameters(cs *api.ContainerService, generatorCode string, acsengineVers | |||
for _, agentProfile := range properties.AgentPoolProfiles { | |||
addValue(parametersMap, fmt.Sprintf("%sCount", agentProfile.Name), agentProfile.Count) | |||
addValue(parametersMap, fmt.Sprintf("%sVMSize", agentProfile.Name), agentProfile.VMSize) | |||
if agentProfile.AvailabilityZones != nil && len(agentProfile.AvailabilityZones) > 0 { |
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.
...and then we just call hasAvailabilityZones
from here
(sorry, the first part of the elipsis is below ;) )
Basically, that way HasAvailabilityZones
in the params template directly correlates to the criteria here. We always want to define the param, and then inject it using this addValue
function, according to the exact same criteria.
@ritazh Looks great, added some final comments. Thanks so much! |
pkg/api/vlabs/validate.go
Outdated
} | ||
|
||
if sv.LT(minVersion) { | ||
return errors.Errorf("availabilityZone is only available in Kubernetes version 1.12 or greater.") |
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.
nit: This should be errors.New
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon, jackfrancis, sozercan 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 |
What this PR does / why we need it:
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #1919Special notes for your reviewer:
Work in progress - do not merge
If applicable:
Release note:
//cc @ritazh @kkmsft @khenidak @feiskyer