Create an Azure AKS Cluster

05 Jan 2024 in TIL

I needed to test Azure AKS with the Application Gateway Ingress Controller. Thankfully, Azure makes it easy with it's az aks CLI.

Create a new Azure resource group:

bash
az group create --name mheap-test --location uksouth

Create a new AKS cluster with the Azure Application Gateway Ingress Controller enabled:

bash
az aks create --name mheap-aks-test --resource-group mheap-test --node-count 1 --network-plugin azure --enable-managed-identity --enable-addons ingress-appgw --appgw-name mheap-appgw --appgw-subnet-cidr "10.225.0.0/16" --generate-ssh-keys

Configure kubectl to connect to this cluster:

bash
az aks get-credentials --resource-group mheap-test --name mheap-aks-test

Once you've finished testing, delete the AKS cluster and resource group:

bash
az aks delete --name mheap-aks-test --resource-group mheap-test --yes
az group delete --name mheap-test --yes