Skip to content

[Aks]Added parameter AvailabilityZone for New-AzAksNodePool #15312

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

Merged
merged 1 commit into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Aks/Aks/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Added parameter `AvailabilityZone` for `New-AzAksNodePool`. [#14505]

## Version 2.1.1
* Fixed the issue that `Set-AzAks` will fail in Automation Runbook. [#15006]
Expand Down
9 changes: 9 additions & 0 deletions src/Aks/Aks/Commands/NewAzureRmAksNodePool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ public class NewAzureRmAksNodePool : NewOrUpdateAgentPoolBase
[PSArgumentCompleter("AvailabilitySet", "VirtualMachineScaleSets")]
public string VmSetType { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType.")]
public string[] AvailabilityZone { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Create node pool even if it already exists")]
public SwitchParameter Force { get; set; }

Expand Down Expand Up @@ -167,6 +172,10 @@ private AgentPool GetAgentPool()
{
agentPool.ScaleSetPriority = ScaleSetPriority;
}
if (this.IsParameterBound(c => c.AvailabilityZone))
{
agentPool.AvailabilityZones = AvailabilityZone;
}

return agentPool;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Aks/Aks/help/Az.Aks.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Delete node pool from managed cluster.
Update or create a managed Kubernetes cluster.

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

### [Start-AzAksDashboard](Start-AzAksDashboard.md)
Create a Kubectl SSH tunnel to the managed cluster's dashboard.
Expand Down
27 changes: 21 additions & 6 deletions src/Aks/Aks/help/New-AzAksNodePool.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ Create a new node pool in specified cluster.
```
New-AzAksNodePool -ResourceGroupName <String> -ClusterName <String> -Name <String> [-Count <Int32>]
[-OsDiskSize <Int32>] [-VmSize <String>] [-VnetSubnetID <String>] [-MaxPodCount <Int32>] [-OsType <String>]
[-ScaleSetPriority <String>] [-ScaleSetEvictionPolicy <String>] [-VmSetType <String>] [-Force]
[-KubernetesVersion <String>] [-MinCount <Int32>] [-MaxCount <Int32>] [-EnableAutoScaling]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-ScaleSetPriority <String>] [-ScaleSetEvictionPolicy <String>] [-VmSetType <String>]
[-AvailabilityZone <String[]>] [-Force] [-KubernetesVersion <String>] [-MinCount <Int32>] [-MaxCount <Int32>]
[-EnableAutoScaling] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ParentObjectParameterSet
```
New-AzAksNodePool -Name <String> -ClusterObject <PSKubernetesCluster> [-Count <Int32>] [-OsDiskSize <Int32>]
[-VmSize <String>] [-VnetSubnetID <String>] [-MaxPodCount <Int32>] [-OsType <String>]
[-ScaleSetPriority <String>] [-ScaleSetEvictionPolicy <String>] [-VmSetType <String>] [-Force]
[-KubernetesVersion <String>] [-MinCount <Int32>] [-MaxCount <Int32>] [-EnableAutoScaling]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-ScaleSetPriority <String>] [-ScaleSetEvictionPolicy <String>] [-VmSetType <String>]
[-AvailabilityZone <String[]>] [-Force] [-KubernetesVersion <String>] [-MinCount <Int32>] [-MaxCount <Int32>]
[-EnableAutoScaling] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

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

## PARAMETERS

### -AvailabilityZone
Availability zones for nodes. 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
```

### -ClusterName
The name of the managed cluster resource.

Expand Down