Skip to content
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

Add parameter AvailabilityZone for AvailabilityZone #18733

Merged
merged 1 commit into from
Jun 27, 2022
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 @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions src/Aks/Aks/Commands/NewAzureRmAks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
17 changes: 16 additions & 1 deletion src/Aks/Aks/help/New-AzAksCluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ New-AzAksCluster [-NodeVmSetType <String>] [-NodeVnetSubnetID <String>] [-NodeMa
[-NetworkPlugin <String>] [-NetworkPolicy <String>] [-PodCidr <String>] [-ServiceCidr <String>]
[-DnsServiceIP <String>] [-DockerBridgeCidr <String>] [-NodePoolLabel <Hashtable>]
[-AksCustomHeader <Hashtable>] [-LoadBalancerSku <String>] [-Force] [-GenerateSshKey] [-EnableNodePublicIp]
[-NodePublicIPPrefixID <String>] [-ResourceGroupName] <String> [-Name] <String>
[-NodePublicIPPrefixID <String>] [-AvailabilityZone <String[]>] [-ResourceGroupName] <String> [-Name] <String>
[[-ServicePrincipalIdAndSecret] <PSCredential>] [-Location <String>] [-LinuxProfileAdminUserName <String>]
[-DnsNamePrefix <String>] [-KubernetesVersion <String>] [-NodeName <String>] [-NodeMinCount <Int32>]
[-NodeMaxCount <Int32>] [-EnableNodeAutoScaling] [-NodeCount <Int32>] [-NodeOsDiskSize <Int32>]
Expand Down Expand Up @@ -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.

Expand Down