az Verified current stable Not installed? Cloud Infrastructure

Az / Create Aks Cluster

Create Aks Cluster

Creates an Azure Kubernetes Service cluster.

$
Terminal
az aks create -g <resource_group> -n <name> -c <count> --node-vm-size <size>

When To Use

When deploying new applications that require orchestration services.

Pro Tip

Specify `--kubernetes-version` to ensure compatibility with existing workloads; check Azure's supported versions.

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
Creating AKS cluster...

Resource Group: myResourceGroup
Cluster Name: myAKSCluster
Node Count: 3
Node VM Size: Standard_DS2_v2

INFO: Successful cluster creation.  
INFO: You can connect to the AKS cluster with the following command:
    az aks get-credentials --resource-group myResourceGroup --name myAKSCluster

Anatomy of Output

Understanding the result

Name: MyAKSCluster Cluster Name

Indicates the name of the newly created AKS cluster.

Node Count: 3 Node Count

Displays the number of nodes allocated for the cluster.

Provisioning State: Succeeded Provisioning Status

Confirms that the AKS cluster is in a ready state.

Power User Variants

Optimized versions

az aks create -g resource_group -n cluster_name -c 3 --node-vm-size Standard_DS2_v2

Create an AKS cluster with specified VM size and count.

az aks create -g resource_group -n cluster_name --enable-addons monitoring

Create an AKS cluster with monitoring enabled.

Troubleshooting

Common pitfalls

Error creating the AKS cluster: quota exceeded.

Solution: Review your Azure subscription quotas and possibly increase limits.

InvalidParameter: VM size not supported.

Solution: Check Azure's VM size compatibility for AKS.

Error: resource group not found.

Solution: Ensure the specified resource group exists in Azure.

Command Breakdown

What each part is doing

az
Base Command
The executable that performs this operation. Here it runs Az before the shell applies any redirect operators.
-g
g| resource group
The value supplied for g| resource group.
<resource_group>
resource group
The value supplied for resource group.
-n
n| name
The value supplied for n| name.
<name>
name
The value supplied for name.
-c
c| node count
The value supplied for c| node count.
<count>
count
The value supplied for count.
<size>
size
The value supplied for size.
-g
Command Option
Tool-specific option used by this command invocation.
-n
Command Option
Tool-specific option used by this command invocation.
-c
Command Option
Tool-specific option used by this command invocation.
--node-vm-size
Command Option
Tool-specific option used by this command invocation.

How To Run

Execution path

  1. Step 1

    Run: az aks create -g myResourceGroup -n myAKSCluster -c 3 --node-vm-size Standard_DS2_v2

  2. Step 2

    Verify the creation using: az aks show -g myResourceGroup -n myAKSCluster

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.