Kubernetes has become the de facto standard for container orchestration, and Azure Kubernetes Service (AKS) makes it accessible without the operational burden of managing the Kubernetes control plane yourself. With AKS, Microsoft handles the control plane (API server, etcd, scheduler) at no extra cost — you pay only for the worker nodes (VMs) that run your workloads. This guide walks you through creating an AKS cluster, deploying an application, and understanding the key concepts you'll use every day.
Core Kubernetes Concepts for AKS
Before diving into AKS, make sure you are comfortable with these Kubernetes primitives:
- Pod: The smallest deployable unit — one or more containers sharing a network namespace and storage.
- Deployment: Manages a set of identical Pods, handles rolling updates and rollbacks.
- Service: A stable virtual IP and DNS name that load-balances traffic to a set of Pods.
- Namespace: A logical partition of the cluster for isolating resources by team or environment.
- ConfigMap / Secret: External configuration and sensitive data injected into Pods as environment variables or mounted files.
- Ingress: HTTP/HTTPS routing rules that expose multiple services through a single external IP.
Creating an AKS Cluster
# Create a resource group
az group create --name rg-aks-demo --location eastus
# Create a cluster with 2 nodes (Standard_D2s_v3)
az aks create
--resource-group rg-aks-demo
--name aks-demo
--node-count 2
--node-vm-size Standard_D2s_v3
--enable-managed-identity
--enable-addons monitoring
--generate-ssh-keys
# Download the kubectl credentials
az aks get-credentials
--resource-group rg-aks-demo
--name aks-demo
# Verify cluster access
kubectl get nodes
The --enable-addons monitoring flag connects the cluster to a Log Analytics Workspace for Container Insights — detailed CPU, memory, and pod-level metrics in Azure Monitor.
Deploying Your First Application
Create a Kubernetes manifest file for a simple nginx deployment:
cat <<EOF | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deploy
namespace: default
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.25
ports:
- containerPort: 80
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "256Mi"
---
apiVersion: v1
kind: Service
metadata:
name: nginx-svc
spec:
type: LoadBalancer
selector:
app: nginx
ports:
- port: 80
targetPort: 80
EOF
# Wait for the external IP
kubectl get service nginx-svc --watch
When you create a Service of type LoadBalancer in AKS, Azure automatically provisions a public Azure Load Balancer and assigns a public IP — the entire provisioning takes 1-2 minutes.
Node Pools and Scaling
AKS supports multiple node pools — groups of VMs with the same size and configuration. Use separate node pools for different workload types:
- A general-purpose pool for web and API services.
- A memory-optimized pool for databases and caching.
- A spot instance pool for batch jobs and CI runners.
# Add a spot node pool for batch workloads
az aks nodepool add
--resource-group rg-aks-demo
--cluster-name aks-demo
--name spotpool
--node-count 0
--min-count 0
--max-count 5
--enable-cluster-autoscaler
--priority Spot
--spot-max-price -1
--node-vm-size Standard_D4s_v3
# Scale the default node pool manually
az aks scale
--resource-group rg-aks-demo
--name aks-demo
--node-count 4
--nodepool-name nodepool1
Cluster Autoscaler
Enable the Cluster Autoscaler to automatically add nodes when Pods cannot be scheduled due to insufficient resources, and remove nodes when they are underutilized. This eliminates manual scaling and reduces cost during off-peak hours:
az aks update
--resource-group rg-aks-demo
--name aks-demo
--enable-cluster-autoscaler
--min-count 2
--max-count 10
AKS and Azure Container Registry
Use Azure Container Registry (ACR) to store your private container images. Grant the AKS cluster pull access with a single command:
# Create an ACR
az acr create
--resource-group rg-aks-demo
--name acrdemo2026
--sku Standard
# Attach ACR to AKS (grants AcrPull role)
az aks update
--resource-group rg-aks-demo
--name aks-demo
--attach-acr acrdemo2026
# Build and push an image to ACR
az acr build
--registry acrdemo2026
--image myapp:v1
--file Dockerfile .
Key Takeaways
AKS removes the complexity of managing a Kubernetes control plane so you can focus on deploying and scaling your applications. Start with a two-node cluster using managed identity, enable Container Insights from the start, use node pools to match VM types to workload requirements, and attach Azure Container Registry for private image storage. AKS is the right foundation for any containerized application that needs production-grade orchestration on Azure.