Exercise 1: Create An AKS Cluster
Task 1 - Login into your subscription
Login to Azure.
az loginaz loginSet the current subscription.
az account set --subscription "<your subscription name or ID>"az account set --subscription "<your subscription name or ID>"
Task 2 - Define variables and create resource group
Select the region closest to your location. Use ‘eastus’ for United States workshops, ‘westeurope’ for European workshops. Ask your instructor for other options in your region.
Set your initials.
$YOUR_INITIALS="abc"YOUR_INITIALS="abc"Define global variables
$INITIALS="$($YOUR_INITIALS)".ToLower() $RESOURCE_GROUP="azure-$($INITIALS)-rg" $LOCATION="swedencentral"INITIALS=$(echo $YOUR_INITIALS | tr '[:upper:]' '[:lower:]') RESOURCE_GROUP="azure-${INITIALS}-rg" LOCATION="swedencentral"Set the VM SKU
$VM_SKU="Standard_D4s_v5"VM_SKU="Standard_D4s_v5"
Task 3 - Create resource group and a basic cluster using Azure CLI
Create Resource Group.
az group create --location $LOCATION ` --resource-group $RESOURCE_GROUPaz group create --location $LOCATION \ --resource-group $RESOURCE_GROUPDefine variables for AKS cluster.
$AKS_NAME="aks-$($INITIALS)" Write-Host "AKS Cluster Name: $AKS_NAME"AKS_NAME="aks-${INITIALS}" echo "AKS Cluster Name: $AKS_NAME"Create a simple AKS cluster.
az aks create --node-count 2 ` --generate-ssh-keys ` --node-vm-size $VM_SKU ` --name $AKS_NAME ` --enable-addons monitoring,azure-keyvault-secrets-provider ` --enable-gateway-api ` --enable-app-routing-istio ` --network-plugin azure ` --network-plugin-mode overlay ` --pod-cidr 192.168.0.0/16 ` --network-dataplane cilium ` --resource-group $RESOURCE_GROUP ` --location $LOCATIONaz aks create --node-count 2 \ --generate-ssh-keys \ --node-vm-size $VM_SKU \ --name $AKS_NAME \ --enable-addons monitoring,azure-keyvault-secrets-provider \ --enable-gateway-api \ --enable-app-routing-istio \ --network-plugin azure \ --network-plugin-mode overlay \ --pod-cidr 192.168.0.0/16 \ --network-dataplane cilium \ --resource-group $RESOURCE_GROUP \ --location $LOCATIONThe creation process will take able 5-10 minutes.
Info
This command enables the Application Routing Add-on with the Gateway API (
--enable-app-routing-istio) along with the Managed Gateway API CRDs (--enable-gateway-api). This is the recommended managed ingress option and the successor to the older managed Nginx add-on, which loses Azure support after November 2026. You will use it in Exercise 7 . This requiresazure-cliversion 2.86.0 or higher — runaz versionto check andaz upgradeif needed.Once complete, connect the cluster to your local client machine.
az aks get-credentials --name $AKS_NAME ` --resource-group $RESOURCE_GROUPaz aks get-credentials --name $AKS_NAME \ --resource-group $RESOURCE_GROUPConfirm the connection to the cluster.
kubectl get nodeskubectl get nodes
This should return a list of nodes similar to the one below:
