diff --git a/src/Aks/Aks/ChangeLog.md b/src/Aks/Aks/ChangeLog.md index d175819c05be..c232eead0d0d 100644 --- a/src/Aks/Aks/ChangeLog.md +++ b/src/Aks/Aks/ChangeLog.md @@ -23,6 +23,7 @@ * Added property `PowerState` for the output of `Get-AzAksCluster`[#18271] * Updated the logic of `Set-AzAksCluster` for parameter `NodeImageOnly`. * Added parameter `NodeImageOnly` for `Update-AzAksNodePool`. +* Added parameter `AvailabilityZone` for `New-AzAksCluster`. [#18658] ## Version 4.1.0 * Removed these aliases: diff --git a/src/Aks/Aks/Commands/NewAzureRmAks.cs b/src/Aks/Aks/Commands/NewAzureRmAks.cs index b05e8b6ec852..8a2f8624bd22 100644 --- a/src/Aks/Aks/Commands/NewAzureRmAks.cs +++ b/src/Aks/Aks/Commands/NewAzureRmAks.cs @@ -137,6 +137,10 @@ public class NewAzureRmAks : CreateOrUpdateKubeBase [Parameter(Mandatory = false, HelpMessage = "The resource Id of public IP prefix for node pool.")] public string NodePublicIPPrefixID { get; set; } + [Parameter( + Mandatory = false, + HelpMessage = "Availability zones for cluster. Must use VirtualMachineScaleSets AgentPoolType.")] + public string[] AvailabilityZone { get; set; } private AcsServicePrincipal acsServicePrincipal; @@ -468,6 +472,11 @@ private ManagedClusterAgentPoolProfile GetAgentPoolProfile() defaultAgentPoolProfile.NodeLabels.Add(key.ToString(), NodePoolLabel[key].ToString()); } } + if (this.IsParameterBound(c => c.AvailabilityZone)) + { + defaultAgentPoolProfile.AvailabilityZones = AvailabilityZone; + } + defaultAgentPoolProfile.Mode = NodePoolMode; return defaultAgentPoolProfile; diff --git a/src/Aks/Aks/help/New-AzAksCluster.md b/src/Aks/Aks/help/New-AzAksCluster.md index 6efa96d2b809..4fca6df25e1b 100644 --- a/src/Aks/Aks/help/New-AzAksCluster.md +++ b/src/Aks/Aks/help/New-AzAksCluster.md @@ -24,7 +24,7 @@ New-AzAksCluster [-NodeVmSetType ] [-NodeVnetSubnetID ] [-NodeMa [-NetworkPlugin ] [-NetworkPolicy ] [-PodCidr ] [-ServiceCidr ] [-DnsServiceIP ] [-DockerBridgeCidr ] [-NodePoolLabel ] [-AksCustomHeader ] [-LoadBalancerSku ] [-Force] [-GenerateSshKey] [-EnableNodePublicIp] - [-NodePublicIPPrefixID ] [-ResourceGroupName] [-Name] + [-NodePublicIPPrefixID ] [-AvailabilityZone ] [-ResourceGroupName] [-Name] [[-ServicePrincipalIdAndSecret] ] [-Location ] [-LinuxProfileAdminUserName ] [-DnsNamePrefix ] [-KubernetesVersion ] [-NodeName ] [-NodeMinCount ] [-NodeMaxCount ] [-EnableNodeAutoScaling] [-NodeCount ] [-NodeOsDiskSize ] @@ -167,6 +167,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -AvailabilityZone +Availability zones for cluster. Must use VirtualMachineScaleSets AgentPoolType. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure.