Set-AksHciCluster
Scale the number of control plane nodes, enable or disable the autoscaler, set the autoscaler configuration profile.
Set-AksHciCluster -name <String>
[-controlPlaneNodeCount <int>]
[-enableAutoScaler <boolean>]
[-autoScalerProfileName <string>]
[-controlPlaneVmSize <string>]
Scale the number of control plane nodes or worker nodes in a cluster. The control plane nodes and the worker nodes must be scaled independently.
Set-AksHciCluster -name myCluster -controlPlaneNodeCount 3
Set-AksHciCluster -name myCluster -enableAutoScaler $true
Set-AksHciCluster -name myCluster -enableAutoScaler $true -autoScalerProfileName myAutoScalerProfile
Set-AksHciCluster -name myCluster -enableAutoScaler $false
Set-AksHciCluster -name myCluster -autoScalerProfileName anotherAutoScalerProfile
To update the control plane nodes in mycluster-linux
to use Standard_A4_v2 as the new virtual machine size.
Set-AksHciCluster -name mycluster -controlPlaneVmSize Standard_A4_v2
The alphanumeric name of your Kubernetes cluster.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The number of nodes in your control plane. Default is 1.
Type: System.Int32
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: 1
Accept pipeline input: False
Accept wildcard characters: False
If set to $true
: Enables the workernode autoscaler for the specified AKS hybrid cluster. All nodepools in the cluster will now automatically scale from the minimum to the maximum number of nodes based on demand for additional nodes when the Kubernetes scheduler is not able to find sufficient worker node resources to schedule pods. See the documentation Use PowerShell for cluster autoscaling for more details.
If set to $false: Disables the autoscaler for the specified cluster. The node pools in the cluster will remain at the scale they were when the autoscaler was disabled.
ملاحظة
Unlike in Azure, the autoscaler in AKS hybrid does not have unlimited resources available. It does not reserve resources to ensure automatic scaling can always succeed. If there are other workloads in the cluster, i.e. virtual machines, AKS clusters etc. consuming resources, the autoscaler can potentially fail. You can use the kubectl get events
command to determine the reason why an autoscaler operation has failed. The autoscaler will retry a failed operation based on the settings in the autoscaler configuration profile. See the Use PowerShell for cluster autoscaling article for more details.
Type: System.Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The Name of the autoscaler configuration profile that was defined by the New-AksHciAutoScalerProfile
command. If not specified the default profile is used. See the documentation Use PowerShell for cluster autoscaling for more details.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Change the virtual vm size of a node pool
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
ملاحظة
The parameters windowsNodeCount
and linuxNodeCount
have been deprecated and removed from the Set-AksHciCLuster
command. Use the count
parameter for the Set-AksHciNodePool
command to manually change the number of worker nodes in a nodepool of an AKS hybrid cluster.