Search code examples
azurekubernetesazure-aks

Deployment failed on kubernetes cluster


I'm trying to deploy my AKS Cluster with node pool 1 and node size as Standard_B2s using below code:

az aks create --name Aks --max-count 1 --min-count 1 --network-plugin azure --vnet-subnet-id /subscriptions/<SUBID>/resourceGroups/MyResources/providers/Microsoft.Network/virtualNetworks/MyVnet/subnets/Mysubnet --node-count 1 --node-vm-size Standard_B2s --dns-service-ip X.X.X.X --resource-group MyResources --generate-ssh-keys --enable-cluster-autoscaler --service-cidr X.X.X.X/X

Whenever I try to deploy, I am getting the error deployment failed :-

code : DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"ResourceDeploymentFailure","message":"The resource provision operation did not complete within the allowed timeout period.}}

Can anyone help me resolving this error?


Solution

  • I tried to reproduce the same in my environment and got the results like below:

    To resolve this issue, try to use below command

    az aks create --resource-group <rgname>--name imran --max-count 1 --min-count 1 --network-plugin azure --vnet-subnet-id /subscriptions/d689e7fb-47d7-4fc3-b0db-xxxxxxx/resourceGroups/<RGname>/providers/Microsoft.Network/virtualNetworks/<vnetName>/subnets/Subnet1 --node-count 1 --node-vm-size Standard_B2s --dns-service-ip 10.2.X.X --service-cidr 10.2.0.X.X --generate-ssh-keys --enable-cluster-autoscaler 
    

    enter image description here

    This issue occurs If you temporarily disable the active NSGs that have been applied to the subnet, Network security group of subnets that are blocking the traffic flow. Try to build a new subnet with no NSG as shown below.

    enter image description here

    Note: if you are using existing Vnet try to disable NSG security group as None

    To confirm in portal azure AKS cluster deployed successfully like below

    enter image description here