I am facing the issue while creating a NAP node pool through Azure portal
Every time I try to create a new NAP pool, I am getting the error that the name is already taken, please choose a different name. No matter what name I use. I have already enabled Karpenter in my AKS cluster using the portal. But what next to do after that to create a scaled node pool?
-
Manish Deshpande 7,010 Reputation points ⢠Microsoft External Staff ⢠Moderator
Hello @cargobuddy
- Private DNS Zone is not linked to your VM's subnet (most likely root cause).
When AKS creates a private cluster, it automatically creates a Private DNS Zone (something like
privatelink.<region>.azmk8s.io) and links it to the AKS VNet. The problem is that this DNS zone is only linked to the AKS VNet by default ā not to your VM's subnet, even if both are in the same VNet.Without this DNS link, your VM can't resolve the private FQDN of the API server, so
kubectlcommands silently fail or time out, and the portal can't reach the cluster to display nodes/pods either.To verify and fix this, run:
Check if your VNet has the DNS zone linked
az network private-dns link vnet list \ --resource-group <AKS_NODE_RESOURCE_GROUP> \ --zone-name <your-private-dns-zone>If your VM's VNet isn't listed, add the link:
az network private-dns link vnet create \ --resource-group <AKS_NODE_RESOURCE_GROUP> \ --zone-name <your-private-dns-zone> \ --name MyVNetLink \ --virtual-network <YOUR_VNET_ID> \ --registration-enabled falseCreate a private AKS cluster ā DNS configuration options
https://learn.microsoft.com/en-us/azure/aks/private-cluster#options-for-connecting-to-the-private-cluster2.Azure RBAC role on the AKS resource itself
Yes, to answer your question directly ā the identity you're using on the bastion VM does need a specific Azure role on the AKS cluster resource (not just inside Kubernetes). Without
Azure Kubernetes Service Cluster User Role(orCluster Admin Role), you can't even runaz aks get-credentialsto pull down the kubeconfig.Assign it like this:
AKS_ID=$(az aks show \ --resource-group <RESOURCE_GROUP> \ --name <CLUSTER_NAME> \ --query id -o tsv) az role assignment create \ --assignee <USER_OR_MANAGED_IDENTITY_PRINCIPAL_ID> \ --role "Azure Kubernetes Service Cluster User Role" \ --scope $AKS_IDThen pull the credentials *from the bastion VM itself:
az login # or use managed identity: az login --identity az aks get-credentials --resource-group <RG> --name <CLUSTER_NAME> kubectl get pods --all-namespacesUse Azure RBAC for Kubernetes authorization
https://learn.microsoft.com/en-us/azure/aks/manage-azure-rbac3.NSG rules between subnets
Since your VM and AKS nodes are in different subnets (even within the same VNet), NSG rules can block the required traffic. Make sure outbound TCP port 443 is allowed from your VM's subnet toward the AKS subnet (where the private endpoint lives). You can verify the private endpoint IP with:
Azure PowerShell
az network private-endpoint show \ --name <PRIVATE_ENDPOINT_NAME> \ --resource-group <AKS_NODE_RESOURCE_GROUP> \ --query 'customDnsConfigs[].ipAddresses'About the Azure Portal behavior
The fact that the portal shows the cluster but not individual nodes or pods is actually expected for private clusters the portal's backend can't reach your private API server endpoint. To manage it through the portal, you can use the built-in Run Command feature (under the cluster's overview ā "Run command"), which proxies commands through Azure without needing direct network access.
Use the Run command for private AKS clusters:
https://learn.microsoft.com/en-us/azure/aks/access-private-clusterAdditional references:
https://learn.microsoft.com/en-us/azure/aks/private-cluster https://learn.microsoft.com/en-us/azure/aks/concepts-identity
https://learn.microsoft.com/en-us/azure/aks/private-cluster#configure-private-dns-zone
Thanks,
Manish. -
Manish Deshpande 7,010 Reputation points ⢠Microsoft External Staff ⢠Moderator
Hello @cargobuddy
I wanted to check if my last response made sense. Iād be glad to assist further or explain anything in more detail
-
cargobuddy 20 Reputation points
I think you have answered for the wrong question. The question was, that I am not able to create a NAP node pool, which I want to create for node level auto-scaling. Whereas, you answered me for a question which I asked in a different thread.
Sign in to comment
1 answer
-
SUNOJ KUMAR YELURU 18,336 Reputation points ⢠MVP ⢠Volunteer Moderator
Hello @cargobuddy,
Thank you for reaching out Q&A forum.
When creating a and encountering an error stating that the name is already taken, it is important to ensure that the name you are trying to use is unique within the scope of your AKS cluster. If you have already enabled Karpenter in your AKS cluster, the next steps to create a scaled node pool include:
- Verify Node Pool Configuration: Ensure that your
NodePoolconfiguration is correct and that it does not conflict with existing node pools. You can check the existing node pools using the Azure CLI or the Azure portal. - Use Unique Names: Make sure that the name you are trying to use for the new NAP node pool is not already in use by another node pool. Each
NodePoolmust have a unique name within the AKS cluster. If you are unsure, try using a completely different name. - Configure
AKSNodeClass: If you want to customize the node pool further, you can configureAKSNodeClassresources to define Azure-specific settings for NAP. This includes settings like VM image, OS disk size, and maximum pods per node. EachNodePoolmust reference anAKSNodeClassusingspec.template.spec.nodeClassRef.
If this answers your query, do click
Accept Answerand Up-Vote for the same. And, if you have any further query do let us know.-
cargobuddy 20 Reputation points
But I tried all sort of names. Even any random name, if I provide, it returns with the error that the name is already taken. This is quite confusing to me.
-
cargobuddy 20 Reputation points
@SUNOJ KUMAR YELURU for any given name, it results into the same error. No matter what name I specify. I gave a random name like onvpowqhef22safwqf, but it still results in the same error. So I think the underlying root cause is different. Further, in my AKS cluster, I already have nodes with manual scaling in place. I want to switch to the auto-scaled nodes with NAP. For that only, I raised this question.
Sign in to comment - Verify Node Pool Configuration: Ensure that your
