Skip to content

Commit 6255cab

Browse files
authored
Added parameter AvailabilityZone for New-AzAksNodePool (Azure#15312)
Co-authored-by: wyunchi-ms <[email protected]>
1 parent 65a2037 commit 6255cab

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed

src/Aks/Aks/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Added parameter `AvailabilityZone` for `New-AzAksNodePool`. [#14505]
2122

2223
## Version 2.1.1
2324
* Fixed the issue that `Set-AzAks` will fail in Automation Runbook. [#15006]

src/Aks/Aks/Commands/NewAzureRmAksNodePool.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ public class NewAzureRmAksNodePool : NewOrUpdateAgentPoolBase
8383
[PSArgumentCompleter("AvailabilitySet", "VirtualMachineScaleSets")]
8484
public string VmSetType { get; set; }
8585

86+
[Parameter(
87+
Mandatory = false,
88+
HelpMessage = "Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType.")]
89+
public string[] AvailabilityZone { get; set; }
90+
8691
[Parameter(Mandatory = false, HelpMessage = "Create node pool even if it already exists")]
8792
public SwitchParameter Force { get; set; }
8893

@@ -167,6 +172,10 @@ private AgentPool GetAgentPool()
167172
{
168173
agentPool.ScaleSetPriority = ScaleSetPriority;
169174
}
175+
if (this.IsParameterBound(c => c.AvailabilityZone))
176+
{
177+
agentPool.AvailabilityZones = AvailabilityZone;
178+
}
170179

171180
return agentPool;
172181
}

src/Aks/Aks/help/Az.Aks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Delete node pool from managed cluster.
4848
Update or create a managed Kubernetes cluster.
4949

5050
### [Set-AzAksClusterCredential](Set-AzAksClusterCredential.md)
51-
Reset the ServicePrincipal of a existing aks cluster.
51+
Reset the ServicePrincipal of an existing AKS cluster.
5252

5353
### [Start-AzAksDashboard](Start-AzAksDashboard.md)
5454
Create a Kubectl SSH tunnel to the managed cluster's dashboard.

src/Aks/Aks/help/New-AzAksNodePool.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ Create a new node pool in specified cluster.
1616
```
1717
New-AzAksNodePool -ResourceGroupName <String> -ClusterName <String> -Name <String> [-Count <Int32>]
1818
[-OsDiskSize <Int32>] [-VmSize <String>] [-VnetSubnetID <String>] [-MaxPodCount <Int32>] [-OsType <String>]
19-
[-ScaleSetPriority <String>] [-ScaleSetEvictionPolicy <String>] [-VmSetType <String>] [-Force]
20-
[-KubernetesVersion <String>] [-MinCount <Int32>] [-MaxCount <Int32>] [-EnableAutoScaling]
21-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
19+
[-ScaleSetPriority <String>] [-ScaleSetEvictionPolicy <String>] [-VmSetType <String>]
20+
[-AvailabilityZone <String[]>] [-Force] [-KubernetesVersion <String>] [-MinCount <Int32>] [-MaxCount <Int32>]
21+
[-EnableAutoScaling] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2222
```
2323

2424
### ParentObjectParameterSet
2525
```
2626
New-AzAksNodePool -Name <String> -ClusterObject <PSKubernetesCluster> [-Count <Int32>] [-OsDiskSize <Int32>]
2727
[-VmSize <String>] [-VnetSubnetID <String>] [-MaxPodCount <Int32>] [-OsType <String>]
28-
[-ScaleSetPriority <String>] [-ScaleSetEvictionPolicy <String>] [-VmSetType <String>] [-Force]
29-
[-KubernetesVersion <String>] [-MinCount <Int32>] [-MaxCount <Int32>] [-EnableAutoScaling]
30-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
28+
[-ScaleSetPriority <String>] [-ScaleSetEvictionPolicy <String>] [-VmSetType <String>]
29+
[-AvailabilityZone <String[]>] [-Force] [-KubernetesVersion <String>] [-MinCount <Int32>] [-MaxCount <Int32>]
30+
[-EnableAutoScaling] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
3131
```
3232

3333
## DESCRIPTION
@@ -49,6 +49,21 @@ PS C:\> New-AzAksNodePool -ResourceGroupName myResourceGroup -ClusterName myClus
4949

5050
## PARAMETERS
5151

52+
### -AvailabilityZone
53+
Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType.
54+
55+
```yaml
56+
Type: System.String[]
57+
Parameter Sets: (All)
58+
Aliases:
59+
60+
Required: False
61+
Position: Named
62+
Default value: None
63+
Accept pipeline input: False
64+
Accept wildcard characters: False
65+
```
66+
5267
### -ClusterName
5368
The name of the managed cluster resource.
5469

0 commit comments

Comments
 (0)