All Articles
How-toยท6 min read

How to Cut Your AKS Cluster Costs Without Hurting Reliability

AKS bills you for the VMs behind your node pools whether or not your pods use them. Here is how to right-size and scale so you stop paying for idle capacity.

Part of: Microsoft Azure Cloud Engineer

Azure Kubernetes Service is free to run โ€” you pay for the VMs in the node pools underneath it. Most AKS bills are inflated by nodes that sit half-empty. Here is how to bring the cost down without touching reliability.

Step 1: Right-Size Your Node Pools

Big general-purpose VMs are easy to over-provision. Look at real CPU and memory usage, then pick a VM size where pods pack tightly. Use separate node pools for workloads with different profiles rather than one oversized pool:

az aks nodepool add \ --resource-group my-rg --cluster-name my-aks \ --name memorypool --node-vm-size Standard_E4s_v5 \ --labels workload=memory-heavy

Step 2: Turn On the Cluster Autoscaler

Without autoscaling you pay for peak capacity around the clock. The cluster autoscaler adds nodes under pressure and removes them when pods no longer need them:

az aks nodepool update \ --resource-group my-rg --cluster-name my-aks --name nodepool1 \ --enable-cluster-autoscaler --min-count 2 --max-count 10

Set the minimum to what you need at the quietest hour, not the busiest.

Step 3: Use the Spot Node Pool for Interruptible Work

Batch jobs, CI runners, and stateless workers that tolerate eviction can run on Spot VMs at a large discount. Keep production traffic on regular nodes and taint the spot pool so only opt-in workloads land there:

az aks nodepool add \ --resource-group my-rg --cluster-name my-aks --name spotpool \ --priority Spot --eviction-policy Delete --spot-max-price -1 \ --node-vm-size Standard_D4s_v5

Step 4: Set Requests So the Scheduler Can Pack

The autoscaler decides how many nodes you need from pod resource requests. Requests set too high waste capacity; too low and pods get starved. Set requests close to real usage so pods bin-pack efficiently:

resources: requests: cpu: "250m" memory: "256Mi"

Summary

AKS cost is node cost. Right-size your VM SKUs and split workloads into purpose-fit node pools, enable the cluster autoscaler so you pay for load instead of peak, push interruptible jobs onto Spot nodes, and set accurate resource requests so the scheduler packs pods tightly. Do those four things and idle capacity โ€” the bulk of most AKS bills โ€” largely disappears, with production reliability untouched.

#Azure#AKS#Kubernetes#Cost

Want to go deeper?

Microsoft Azure Cloud Engineer

View Course