Create an AKS cluster and deploy an app

DevOps, Hands On25 minutesCosts moneySteps checked 14 November 2026By Cloud Hands On

In this task you'll create a small AKS cluster and run an app on it.

Azure Kubernetes Service (AKS) runs the Kubernetes control plane for you (free on the Free tier); you pay for the nodes, the VMs your containers run on.

You describe what should run in YAML: a Deployment keeps a number of identical pods running, and a Service gives them one stable address. kubectl apply sends the YAML; Kubernetes makes it so and keeps it so.

Example. SS Kaiser runs its shop as a Deployment of 3 pods behind a Service. When a node fails, Kubernetes starts replacement pods elsewhere without anyone being paged.

Costs money. This task creates resources that are charged while they exist. Delete them as soon as you finish.

Before you start

You need: Contributor on a resource group. Time: 25 minutes.

Where to look

  1. Home
  2. Kubernetes services
  3. Create
  4. Kubernetes cluster

Steps

  1. Create a cluster: az aks create -g rg-dv-practice -n aks-practice --node-count 1 --node-vm-size Standard_D2as_v5 --tier free --generate-ssh-keys.About 5 minutes. On our free trial UK regions had no sizes for AKS: Sweden Central worked. B-series sizes are refused.
  2. Run az aks get-credentials -g rg-dv-practice -n aks-practice, then kubectl get nodes.
  3. Run kubectl create deployment web --image=mcr.microsoft.com/azuredocs/aks-helloworld:v1 --replicas=2.
  4. Run kubectl expose deployment web --type LoadBalancer --port 80, then kubectl get svc web -w until it has an EXTERNAL-IP. Open it in a browser.

Commands

az aks create -g rg-dv-practice -n aks-practice --node-count 1 --node-vm-size Standard_D2as_v5 --tier free --generate-ssh-keys
az aks get-credentials -g rg-dv-practice -n aks-practice
kubectl create deployment web --image=mcr.microsoft.com/azuredocs/aks-helloworld:v1 --replicas=2
kubectl expose deployment web --type LoadBalancer --port 80
kubectl get svc web -w

Watch out for

Cost
One D2as_v5 node is about 8p an hour plus a public IP. Stop or delete the cluster when you finish.
Security
Keep the API server's access limited, use Entra ID integration for real clusters, and never expose dashboards publicly.
Common mistakes
Leaving a cluster running overnight, and creating LoadBalancer services for everything (each is a public IP).

Clean up

Delete the resource group, or stop the cluster with az aks stop if you'll come back soon.

Words to know

Pod
One or more containers that run together; the smallest thing Kubernetes schedules.
Deployment
Keeps a set number of identical pods running and manages updates.
Service
A stable address in front of pods; type LoadBalancer adds a public IP.
Namespace
A folder inside the cluster for a team or app.

Tick off each step and track your progress in the guide.

Open this task in DevOps, Hands On

Keep going