In this post, I will show you how to deploy an Azure AKS cluster with Azure Resource Manager (ARM) template.
Since AKS is an ever-evolving product and service, there are a few ARM templates for it, and I have to say that the first releases were a bit hard to deploy because you had to specify a service principal account details and SSH key to get the deployment going.
With the below template, AKS is using a managed identity account and also using a Virtual Machine Scale Set (VMSS) which also reduces the template configuration and doesn’t require and SSH key.
For this deployment, I’m using the following template:
Go ahead and clone the entire repo and copy following files to a folder.
By default the temple will name the cluster with a random name, so you would like to use a specific name edit the two values in the parameters file. You can see them below.
To deploy the temple login to azure and set the subscription (if you have only one you don’t worry about the subscription command).
az login az account set --subscription pay-as-you-go
To create a resource group run the following command:
az group create --name AKS-RG02 --location "West US"
The final command will start the deployment and it is shown below:
az deployment group create --name deploy001 --resource-group AKS-RG2 --template-file .\azuredeploy.json --parameters .\azuredeploy.parameters.json --verbose
After a few minutes the AKS cluster will appear in Azure. To get started with ARM please visit this post.