AKS – Add second node pool on different subnet

By | September 5, 2020

Hi Guys,

If you want to deploy a second nodepool on different subnet in same VNET, you can do it with preview feature. ๐Ÿ™‚

You can find detaailed information about it using the link below. (Not detailed but enough ๐Ÿ™‚ )

https://docs.microsoft.com/en-us/azure/aks/use-multiple-node-pools

The preview feature has some limitation like ;

  • All subnets assigned to nodepools must belong to the same virtual network.
  • System pods must have access to all nodes in the cluster to provide critical functionality such as DNS resolution via coreDNS.
  • Assignment of a unique subnet per node pool is limited to Azure CNI during preview.
  • Using network policies with a unique subnet per node pool is not supported during preview.

The implementaion is so basic. All you have to do is follow the steps below.

  • Add a second subnet on the vnet that AKS deployed. The subnet must use same ip range with AKS subnet. If you add a different subnet and try to add second node pool on it, you face the issue like below.
  • We need subnetid to use nodepool creation. So you can use this command to have it.
az network vnet subnet show --name newSubnet --resource-group TEST-AKS-CLUSTER --vnet-name TEST-AKS-CLUSTER-vnet
  • Finally, you can add the nodepool by running the nodepool add command as follows.
az aks nodepool add \
    --resource-group TEST-AKS-CLUSTER \
    --cluster-name aks02 \
    --name prxypool \
    --node-count 1 \
    --node-vm-size standard_d2s_v3 \
    --vnet-subnet-id <subnet id>

After completing these processes sequentially, the new nodepool will be successfully added to a different subnet in vnet.

I hope it has been a useful article. See you another one.

Cheers.

Leave a Reply

Your email address will not be published. Required fields are marked *