0

I am trying to create a new node pool in a newly created subnet with this command

az aks nodepool add \
    --resource-group nems12 \
    --cluster-name nems-cluster \
    --name aksperfnode \
    --node-count 1 \
    --vnet-subnet-id aks2

But getting an error Agent pools subnet is not in Vnet CIDR but it is actually added in vnet address space and a subnet is created for it

Chris
  • 5,109
  • 3
  • 19
  • 40
  • Could you please check that the subnet assigned to the AKS node pool is not a delegated subnet. Also the cluster identity used by the AKS cluster must have at least Network Contributor permissions on the subnet within your virtual network. https://learn.microsoft.com/en-us/azure/aks/configure-azure-cni#prerequisites – Andriy Bilous Jul 04 '22 at 14:35

1 Answers1

0

I tested in my environment its working fine for me. You need to provide --vnet-subnet-id in this format /subscriptions/b83c1eXXXXX5ba-2bXXXXX23f/resourceGroups/v-raxXXXXee/providers/Microsoft.Network/virtualNetworks/TestVNET/subnets/AKS-Subnet.

enter image description here

enter image description here

Note : As Andriy Bilous also check that suggestion if you are still getting an error after followed my solution.

  • please check that the subnet assigned to the AKS node pool is not a delegated subnet.

  • Select NSG as None for your existing Subnet. Which might sometime cause error.

enter image description here

RahulKumarShaw
  • 4,192
  • 2
  • 5
  • 11