AKS add windows node pool

Dondapati, Navin 291 Reputation points
2023-05-09T15:48:14.0866667+00:00

Hi Guys,

We are trying windows pool on AKS using below power shell but it fails:

aks nodepool add --resource-group rg1--cluster-name aks01--os-type Windows --name npwcd --node-vm-size Standard_D4s_v3 --kubernetes-version 1.25.6 --aks-custom-headers WindowsContainerRuntime=containerd --node-count 1  --network-plugin azure --windows-admin-username azure --windows-admin-password 'Password'

unrecognized arguments: --windows-admin-username azure --windows-admin-password Password

tried below

az aks nodepool add --resource-group rg1 --cluster-name aksdev001 --os-type Windows --os-sku Windows2019 --name npwin --node-count 1

(WindowsProfileMissing) Windows profile definition is missing for the cluster.

Code: WindowsProfileMissing

Message: Windows profile definition is missing for the cluster.

We tried below it works, but why cant we use az aks nodepool add?

az aks create --resource-group rg1 --name aks-byo-cni-win --node-count 1 --nodepool-name systemnp --node-vm-size Standard_DS2_v2 --node-resource-group rg-aks-byo-cni-nodes --generate-ssh-keys --network-plugin none --enable-cluster-autoscaler --min-count 1 --max-count 10 --zones 1 2 3 --windows-admin-username azureuser --windows-admin-password "Script@12345678"

Regards,

Navin

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,447 questions
{count} votes

1 answer

Sort by: Most helpful
  1. shiva patpi 13,366 Reputation points Microsoft Employee Moderator
    2023-05-09T17:14:28.5066667+00:00

    @Anonymous

    There is no option for adding windows admin username & password while creating the new nodepool . Those credentials needs to be added at the time of AKS cluster creation.

    From the below document , the command az aks nodepool add - you don't see any flag for --windows-admin-username & --windows-admin-password.

    https://learn.microsoft.com/en-us/cli/azure/aks/nodepool?view=azure-cli-latest#az-aks-nodepool-add

    Those are available only at the time of AKS cluster creation (see the command az aks create in below official document)

    https://learn.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest#az-aks-create

    ////////////////

    While creating the AKS cluster , if you have not added the windows-admin-username - there will be a default user name called : azureuser (You can get those details from az aks show -g resourcegroupname -n aksclustername)

    You can use the new password by going to Azure Portal windows VMSS nodes -> Reset Password.

    Hope that explanation helps ! Kindly Let us know if you have any additional questions !!

    Regards,

    Shiva.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.