Upravit

Sdílet prostřednictvím


New-AzAksNodePool

Create a new node pool in specified cluster.

Syntax

New-AzAksNodePool
   -ResourceGroupName <String>
   -ClusterName <String>
   -Name <String>
   [-Count <Int32>]
   [-OsDiskSize <Int32>]
   [-VmSize <String>]
   [-VnetSubnetID <String>]
   [-MaxPodCount <Int32>]
   [-OsType <String>]
   [-OsSKU <String>]
   [-EnableNodePublicIp]
   [-NodePublicIPPrefixID <String>]
   [-ScaleSetPriority <String>]
   [-ScaleSetEvictionPolicy <String>]
   [-VmSetType <String>]
   [-AvailabilityZone <String[]>]
   [-Force]
   [-EnableEncryptionAtHost]
   [-EnableUltraSSD]
   [-LinuxOSConfig <LinuxOSConfig>]
   [-KubeletConfig <KubeletConfig>]
   [-MaxSurge <String>]
   [-PPG <String>]
   [-SpotMaxPrice <Double>]
   [-EnableFIPS]
   [-GpuInstanceProfile <String>]
   [-HostGroupID <String>]
   [-PodSubnetID <String>]
   [-KubernetesVersion <String>]
   [-MinCount <Int32>]
   [-MaxCount <Int32>]
   [-EnableAutoScaling]
   [-Mode <String>]
   [-NodeLabel <Hashtable>]
   [-Tag <Hashtable>]
   [-NodeTaint <String[]>]
   [-AksCustomHeader <Hashtable>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [-SubscriptionId <String>]
   [<CommonParameters>]
New-AzAksNodePool
   -Name <String>
   -ClusterObject <PSKubernetesCluster>
   [-Count <Int32>]
   [-OsDiskSize <Int32>]
   [-VmSize <String>]
   [-VnetSubnetID <String>]
   [-MaxPodCount <Int32>]
   [-OsType <String>]
   [-OsSKU <String>]
   [-EnableNodePublicIp]
   [-NodePublicIPPrefixID <String>]
   [-ScaleSetPriority <String>]
   [-ScaleSetEvictionPolicy <String>]
   [-VmSetType <String>]
   [-AvailabilityZone <String[]>]
   [-Force]
   [-EnableEncryptionAtHost]
   [-EnableUltraSSD]
   [-LinuxOSConfig <LinuxOSConfig>]
   [-KubeletConfig <KubeletConfig>]
   [-MaxSurge <String>]
   [-PPG <String>]
   [-SpotMaxPrice <Double>]
   [-EnableFIPS]
   [-GpuInstanceProfile <String>]
   [-HostGroupID <String>]
   [-PodSubnetID <String>]
   [-KubernetesVersion <String>]
   [-MinCount <Int32>]
   [-MaxCount <Int32>]
   [-EnableAutoScaling]
   [-Mode <String>]
   [-NodeLabel <Hashtable>]
   [-Tag <Hashtable>]
   [-NodeTaint <String[]>]
   [-AksCustomHeader <Hashtable>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [-SubscriptionId <String>]
   [<CommonParameters>]

Description

Create a new node pool in specified cluster.

Examples

Example 1: Create a node pool with default parameters

New-AzAksNodePool -ResourceGroupName myResouceGroup -ClusterName myCluster -Name mydefault

Example 2: Create Windows Server container on an AKS

$cred = ConvertTo-SecureString -String "****" -AsPlainText -Force
New-AzAksCluster -ResourceGroupName myResourceGroup -Name myCluster -WindowsProfileAdminUserName azureuser -WindowsProfileAdminUserPassword $cred -NetworkPlugin azure -NodeVmSetType VirtualMachineScaleSets
New-AzAksNodePool -ResourceGroupName myResourceGroup -ClusterName myCluster -Name win1 -OsType Windows -VmSetType VirtualMachineScaleSets

Example 3: Create a node pool with LinuxOSConfig and KubeletConfig.

When you create an AKS node pool, you can specify the kubelet and OS configurations. The type of LinuxOSConfig and KubeletConfig must be Microsoft.Azure.Management.ContainerService.Models.LinuxOSConfig and Microsoft.Azure.Management.ContainerService.Models.KubeletConfig respectively.

$linuxOsConfigJsonStr = @'
            {
             "transparentHugePageEnabled": "madvise",
             "transparentHugePageDefrag": "defer+madvise",
             "swapFileSizeMB": 1500,
             "sysctls": {
              "netCoreSomaxconn": 163849,
              "netIpv4TcpTwReuse": true,
              "netIpv4IpLocalPortRange": "32000 60000"
             }
            }
'@
$linuxOsConfig = [Microsoft.Azure.Management.ContainerService.Models.LinuxOSConfig] ($linuxOsConfigJsonStr | ConvertFrom-Json)
$kubeletConfigStr = @'
            {
             "failSwapOn": false
            }
'@
$kubeletConfig = [Microsoft.Azure.Management.ContainerService.Models.KubeletConfig] ($kubeletConfigStr | ConvertFrom-Json)

New-AzAksNodePool -ResourceGroupName myResourceGroup -ClusterName myAKSCluster -Name mypool -LinuxOSConfig $linuxOsConfig -KubeletConfig $kubeletConfig

Parameters

-AksCustomHeader

Aks custom headers

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AvailabilityZone

Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ClusterName

The name of the managed cluster resource.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ClusterObject

Specify cluster object in which to create node pool.

Type:PSKubernetesCluster
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Count

The default number of nodes for the node pools.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableAutoScaling

Whether to enable auto-scaler

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableEncryptionAtHost

Whether to enable host based OS and data drive

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableFIPS

Whether to use a FIPS-enabled OS

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableNodePublicIp

Whether to enable public IP for nodes.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableUltraSSD

whether to enable UltraSSD

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Create node pool even if it already exists

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GpuInstanceProfile

The GpuInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-HostGroupID

The fully qualified resource ID of the Dedicated Host Group to provision virtual machines from, used only in creation scenario and not allowed to changed once set.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-KubeletConfig

The Kubelet configuration on the agent pool nodes.

Type:KubeletConfig
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-KubernetesVersion

The version of Kubernetes to use for creating the cluster.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-LinuxOSConfig

The OS configuration of Linux agent nodes.

Type:LinuxOSConfig
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MaxCount

Maximum number of nodes for auto-scaling

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MaxPodCount

Maximum number of pods that can run on node.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MaxSurge

The maximum number or percentage of nodes that ar surged during upgrade.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MinCount

Minimum number of nodes for auto-scaling.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Mode

The pool mode

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name of the node pool.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NodeLabel

Node pool labels used for building Kubernetes network.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NodePublicIPPrefixID

The resource Id of public IP prefix for node pool.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NodeTaint

The node taints added to new nodes during node pool create and scale

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OsDiskSize

The default number of nodes for the node pools.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OsSKU

OsSKU to be used to specify OS SKU. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OsType

OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PodSubnetID

The ID of the subnet which pods will join when launched.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PPG

The ID for Proximity Placement Group.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ScaleSetEvictionPolicy

ScaleSetEvictionPolicy to be used to specify eviction policy for low priority virtual machine scale set. Default to Delete.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ScaleSetPriority

ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SpotMaxPrice

The max price (in US Dollars) you are willing to pay for spot instances. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand.

Type:Nullable<T>[Double]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The ID of the subscription. By default, cmdlets are executed in the subscription that is set in the current context. If the user specifies another subscription, the current cmdlet is executed in the subscription specified by the user. Overriding subscriptions only take effect during the lifecycle of the current cmdlet. It does not change the subscription in the context, and does not affect subsequent cmdlets.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Tag

The tags to be persisted on the agent pool virtual machine scale set.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VmSetType

Represents types of an node pool. Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet'

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VmSize

The size of the Virtual Machine. Default value is Standard_D2_v2.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VnetSubnetID

VNet SubnetID specifies the VNet's subnet identifier.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSKubernetesCluster

Outputs

PSNodePool