Azure AKS: A Practical Guide

Khimananda Oli 9 min read Virtualization
Azure AKS: A Practical Guide

By Khimananda Oli | Last reviewed: August 2026

Deploying managed Kubernetes often introduces hidden complexity around networking, identity, and cost that basic tutorials ignore. This Azure AKS: A Practical Guide addresses those production gaps by focusing on secure defaults, scalable architecture, and operational reality rather than hello-world demos. Whether you are migrating from on-prem or starting fresh, getting the foundation right prevents expensive rework later. For teams already standardizing on Microsoft's ecosystem, aligning your cluster strategy with broader Azure DevOps workflows ensures your infrastructure scales alongside your delivery pipelines.

Managed Control PlaneAPI Server (Free)etcd / SchedulerCloud Controller MgrCustomer Managed Node PoolsSystem PoolCoreDNS / MetricsTaints: CriticalAddonsOnlyUser Pool (App)Business WorkloadsAuto-scaling EnabledAzure CNI / Overlay NetworkPod IPs routable in VNET • Network PoliciesAzure Key VaultCSI Driver / SecretsACR IntegrationPrivate Endpoint
High-level Azure AKS architecture separating the free managed control plane from customer-managed node pools and network integration

How do you provision a secure Azure AKS cluster correctly?

The most common mistake I see when reviewing Azure AKS deployments is treating the cluster as an isolated island rather than an integrated Azure resource. Secure provisioning starts before you run a single az aks create command. You must define your networking model, identity strategy, and node topology upfront because changing them post-deployment often requires a full cluster rebuild.

Choose Azure CNI Overlay over Kubenet

In 2026, Azure CNI Overlay is the recommended default for most production workloads. Unlike Kubenet, which relies on user-defined routes and has scalability limits around 400 nodes per subnet, CNI Overlay assigns pod IPs from a separate CIDR space that is encapsulated within the node's VNET. This gives you native VNET integration without exhausting subnet IP addresses. It also supports Windows nodes and advanced network policies natively.

az aks create \
  --resource-group rg-aks-prod \
  --name aks-prod-eastus \
  --network-plugin azure \
  --network-plugin-mode overlay \
  --pod-cidr 10.244.0.0/16 \
  --service-cidr 10.0.0.0/16 \
  --dns-service-ip 10.0.0.10 \
  --enable-private-cluster \
  --api-server-authorized-ip-ranges "YOUR_OFFICE_IP/32" \
  --node-resource-group rg-aks-prod-nodes \
  --generate-ssh-keys

Enforce Private Cluster Access

Never expose the Kubernetes API server to the public internet unless absolutely necessary. The --enable-private-cluster flag removes the public endpoint entirely. Access the API through a private endpoint in your VNET, Azure Cloud Shell with managed identity, or a jump box in a peered network. If you must allow specific external IPs during migration, use --api-server-authorized-ip-ranges but plan to remove it once private connectivity is established.

Separate System and User Node Pools

Always create at least two node pools: one dedicated system pool for critical cluster components (CoreDNS, metrics-server, kube-proxy) and separate user pools for application workloads. Taint the system pool with CriticalAddonsOnly=true:NoSchedule to prevent business applications from being scheduled there. This isolation ensures that app resource exhaustion never takes down cluster DNS or monitoring.

How does Azure AKS handle identity and secret management?

Identity management is where many AKS deployments fail security audits. Stop using long-lived service principal credentials immediately. In 2026, Azure Workload Identity is the standard for granting pods access to Azure resources like Key Vault, Storage, or SQL Database without embedding secrets in environment variables.

Configure Workload Identity Federation

Workload Identity uses OIDC federation between your AKS cluster and Azure Entra ID. Each Kubernetes service account maps to a specific Azure Managed Identity. When a pod mounts the projected token volume, the Azure SDK exchanges the K8s token for an Entra access token transparently.

  1. Enable OIDC issuer and workload identity on the cluster: az aks update --enable-oidc-issuer --enable-workload-identity
  2. Create a user-assigned managed identity and federated credential linking it to your K8s namespace/service account
  3. Annotate your service account with the Azure client ID: azure.workload.identity/client-id: <managed-identity-client-id>
  4. Add the label azure.workload.identity/use: "true" to pods that should inject the token

Integrate Key Vault via CSI Driver

For secrets that must remain in Key Vault rather than K8s Secrets, use the Azure Key Vault Provider for Secrets Store CSI Driver. This mounts vault entries as files or syncs them to K8s Secrets automatically. Combined with Workload Identity, pods authenticate to Key Vault without any connection strings or passwords stored in the cluster. Enable auto-rotation so updated vault values propagate to running pods without restarts.

AKS PodProjected SA Token/var/run/secrets/azure/tokensAzure SDK / ClientReads token automaticallyAzure Entra IDOIDC Issuer ValidationVerifies K8s token signatureFederated CredentialMaps SA → Managed IdentityAzure ResourceKey VaultBlob / SQL / Cosmos1. Exchange Token3. Access Resource2. Return Access Token
Workload Identity flow: pod exchanges projected service account token for Entra access token via OIDC federation without stored credentials

How do you configure autoscaling and cost optimization in AKS?

Cost overruns in AKS typically stem from three issues: over-provisioned nodes, missing vertical scaling, and ignoring spot instances. Address each layer independently. Horizontal Pod Autoscaler (HPA) adjusts replica counts based on metrics, Vertical Pod Autoscaler (VPA) right-sizes container requests, and Cluster Autoscaler adds or removes nodes based on pending pods. These must be tuned together — HPA alone will not reduce your bill if nodes stay provisioned with idle capacity.

Enable KEDA for Event-Driven Scaling

Standard HPA only reacts to CPU/memory. Most real workloads scale based on queue depth, HTTP request rate, or custom metrics. KEDA (Kubernetes Event-driven Autoscaling) is now a first-class AKS add-on. Install it via az aks addon enable --addon keda and define ScaledObjects that trigger scaling based on Azure Service Bus queue length, Event Hub lag, or Prometheus queries. This eliminates both over-provisioning during quiet periods and under-provisioning during traffic spikes.

Use Spot Node Pools for Fault-Tolerant Workloads

Spot VMs offer 60–90% discounts compared to pay-as-you-go pricing. Create a dedicated spot node pool for batch processing, CI runners, or stateless services that can tolerate eviction. Never put databases, ingress controllers, or system components on spot nodes. Configure pod disruption budgets and graceful shutdown handlers so evictions don't cause data loss or downtime.

az aks nodepool add \
  --resource-group rg-aks-prod \
  --cluster-name aks-prod-eastus \
  --name spotbatch \
  --priority Spot \
  --spot-max-price -1 \
  --eviction-policy Delete \
  --vm-size Standard_D4s_v5 \
  --min-count 0 \
  --max-count 10 \
  --labels workload-type=batch \
  --taints spot=true:NoSchedule

Right-Size with VPA Recommendations

Deploy VPA in recommendation-only mode first (--vpa-recommender-only). Let it collect usage data for 1–2 weeks, then review suggested CPU/memory requests. Apply these recommendations manually or enable auto-mode for non-critical namespaces. Right-sizing typically recovers 20–40% of wasted spend without any architectural changes. Combine this with Azure Advisor insights for additional VM family recommendations.

What are the key differences between AKS networking models?

Networking is the most consequential decision in AKS deployment because it affects performance, security, and scalability permanently. Understanding the trade-offs prevents costly migrations later.

FeatureKubenetAzure CNI OverlayAzure CNI (Classic)
Pod IP SourceNode-local CIDROverlay CIDR (encapsulated)VNET Subnet IPs
Max Nodes/Subnet~400 (route limit)Unlimited (overlay)Limited by subnet size
VNET IntegrationRequires UDRsNativeNative
Network PolicyCalico onlyCilium / CalicoAzure NPM / Cilium
PerformanceGood (NAT overhead)Excellent (eBPF optional)Excellent (direct routing)
Recommended ForLegacy / Simple devNew production clustersDirect pod-to-VNET needs

For new deployments in 2026, choose Azure CNI Overlay unless you have a specific requirement for pods to hold real VNET IPs directly. Classic CNI consumes one VNET IP per pod, which causes subnet exhaustion at scale and complicates multi-cluster peering. Overlay avoids this entirely while maintaining full VNET routability through encapsulation. If you're migrating from Kubenet, plan a blue-green cutover rather than attempting in-place conversion.

KubenetPod: 10.244.x.x (local)Node NAT / UDRVNET Resource⚠ Route table limitsComplex multi-clusterCNI Overlay ✓Pod: 10.244.x.x (overlay)Encapsulation (VXLAN)VNET Resource✓ No route limits✓ Native VNET routingCNI ClassicPod: 10.0.x.x (VNET IP)Direct VNET RoutingVNET Resource⚠ Subnet exhaustion riskLarge subnets required
Packet flow comparison across AKS networking models highlighting why CNI Overlay is preferred for new production deployments

How do you maintain and upgrade AKS clusters safely?

Operational excellence separates demo clusters from production systems. AKS abstracts control plane management but still requires disciplined upgrade planning, monitoring, and backup strategies. Treat your cluster as livestock, not pets — every component should be replaceable through automation.

Implement Planned Maintenance Windows

Define maintenance windows explicitly using az aks maintenanceconfiguration add. Specify allowed days, hours, and duration for both OS patching and Kubernetes version upgrades. Without this, Azure may apply updates during peak business hours. For Nepal-based teams serving local users, schedule windows during late-night IST/NPT overlap to minimize impact. Always test upgrades on a staging cluster first using identical node configurations.

Automate Backup with Velero

AKS does not back up etcd or persistent volumes automatically. Deploy Velero with the Azure plugin to snapshot PVs and export cluster manifests to Azure Blob Storage. Schedule daily backups for production namespaces. Test restores quarterly — untested backups are just hopes. For compliance frameworks like SOC 2 or ISO 27001, documented restore procedures are mandatory evidence.

Monitor with Azure Monitor Container Insights

Enable Container Insights during cluster creation (--enable-addons monitoring). This provides pre-built dashboards for node health, pod restarts, resource saturation, and controller manager latency. Supplement with Prometheus/Grafana for custom application metrics. Set alerts on node NotReady conditions, high eviction rates, and failed deployments. Integrate alerts with your incident response workflow — if you're learning about outages from users instead of monitors, your observability stack is broken.

Moving Forward with Azure AKS

This Azure AKS: A Practical Guide covers the foundations that determine whether your Kubernetes platform accelerates delivery or becomes a maintenance burden. Start with secure defaults: private API access, Workload Identity, CNI Overlay, and separated node pools. Layer in cost controls through KEDA, spot instances, and VPA right-sizing. Automate backups and define maintenance windows before your first production deployment. If you need help designing an AKS architecture that meets your specific compliance, performance, or budget requirements, reach out to discuss your infrastructure needs. For teams building CI/CD alongside their clusters, review how to deploy to AKS with Azure Pipelines for integrated delivery workflows. Remember: if it isn't automated, observable, secure, and audit-ready, it isn't production-ready.

Frequently Asked Questions

Use the Azure CLI command az aks create with managed identity and auto-upgrade enabled. This provisions a production-ready cluster in under ten minutes with default networking and monitoring configured correctly for most workloads.

The control plane is free in standard tier, so costs come from node VMs, storage, and load balancers. A three-node Standard_D2s_v5 cluster typically runs two hundred to three hundred dollars monthly excluding egress charges.

Yes, by adding a dedicated spot node pool separate from your system pool. Configure pod disruption budgets and taints to ensure critical workloads never schedule on interruptible nodes during Azure reclamation events.

AKS Automatic abstracts node management entirely, handling scaling and patching without user intervention. Standard AKS requires manual or configured autoscaler policies for node pools but offers granular control over infrastructure configuration and upgrade cadence.

Enable Microsoft Entra Workload ID during cluster creation using the oidc-issuer flag. This allows pods to authenticate directly via federated credentials, eliminating long-lived secrets and reducing credential rotation overhead significantly.

Azure CNI Overlay is now the recommended default for most clusters in 2026. It provides direct pod IP assignment without exhausting subnet addresses while maintaining native Azure network policy enforcement and performance characteristics.

Run kubectl describe pod followed by kubectl logs with previous flag to inspect crash reasons. Check resource limits, liveness probes, and configmap mounts as these cause most restart loops in fresh AKS deployments.

Yes.

Deploy Azure Firewall with a dedicated egress subnet and configure UDRs on the AKS cluster subnet. Use FQDN filtering rules to allow only required external endpoints while blocking all other outbound traffic by default.

Use Azure Kubernetes Service Backup extension with Velero underneath. It snapshots managed disks and backs up Kubernetes manifests to Azure Blob Storage, enabling cross-region restore without third-party tooling or complex scripting.

Run az aks rotate-certs which triggers a rolling restart of all nodes. Schedule this during maintenance windows as API server becomes briefly unavailable during rotation, though workloads continue serving traffic throughout the process.

Absolutely.

Enable Container Insights with Prometheus metrics addon. Query kube-apiserver latency and etcd leader elections via Azure Monitor workbooks to detect control plane degradation before it impacts workload scheduling or API responsiveness.

Create separate user node pools per tenant with distinct taints and labels. Enforce isolation through namespace quotas and network policies rather than relying solely on node boundaries for security separation between teams.

Use surge upgrades with max-surge set to one or higher. This creates new nodes before draining old ones, ensuring capacity remains constant throughout the upgrade cycle while respecting pod disruption budgets automatically.