Author: Randy Bordeaux
Date: January 2026
Version: 1.0
Document Type: Architecture Brief
Scope: Azure Commercial
Azure Services: Azure Kubernetes Service (AKS), Azure Monitor, Azure Policy, Azure Cost Management
Deployable Terraform: examples/compute/aks-architecture-briefs/cost-optimization/
Architecture Brief — This document covers architectural principles and design decisions. For complete Terraform modules and KQL monitoring queries, see the full whitepaper template.
This architecture brief provides a decision-oriented guide to cost optimization for Azure Kubernetes Service (AKS) in Azure Commercial environments.
- Cost Optimization Strategies for Azure Kubernetes Service
- Executive Summary
- Table of Contents
- 1. Scope and Assumptions
- 2. Cost Architecture Principles
- 3. Primary AKS Cost Drivers
- 4. Node Pool Right-Sizing and VM Selection
- 5. Autoscaling and Capacity Management
- 6. Spot Instances and Workload Segmentation
- 7. Networking and Egress Cost Control
- 8. Storage and Persistent Volume Optimization
- 9. Observability Cost Management
- 10. Governance, Budgets, and Policy Guardrails
- 11. Terraform Implementation Patterns
- 12. Tradeoffs and Limitations
- 13. Conclusion
- Azure Commercial only
- Azure Kubernetes Service (AKS)
- Terraform (AzureRM provider) required
- Private AKS clusters only
- Cost optimization enforced structurally, not manually
- CI/CD-managed infrastructure
- Optimize architecture before tuning workloads
- Align cost domains to ownership boundaries
- Prefer elasticity over static capacity
- Enforce limits to prevent runaway spend
- Make cost visible at the team and workload level
graph TD
AKS[AKS Cluster] --> Compute[Node Pools / VM SKUs]
AKS --> Storage[Disks / Snapshots]
AKS --> Network[Egress / Load Balancers]
AKS --> Logs[Log Analytics Ingestion]
- Node pool VM hours dominate baseline spend
- Egress and NAT traffic are common blind spots
- Log ingestion grows non-linearly with scale
- Use workload-specific node pools
- Avoid over-provisioned general-purpose SKUs
- Prefer memory-optimized SKUs only where justified
- Right-size system node pools aggressively
- Eliminate unused node pools
graph TD
HPA[Horizontal Pod Autoscaler] --> CA[Cluster Autoscaler]
CA --> NP[Node Pools]
- Enable Cluster Autoscaler per node pool
- Enforce pod resource requests and limits
- Avoid fixed-size pools in non-production
- Separate scale characteristics by workload
- Use spot node pools for fault-tolerant workloads
- Explicit taints and tolerations required
- No stateful or control-plane-adjacent workloads
- Expect and design for eviction
- Prefer internal load balancers
- Centralize egress through firewall/NAT
- Avoid unnecessary cross-zone traffic
- Minimize public load balancer usage
- Monitor SNAT and outbound data volume
- Match disk SKU to IOPS requirements
- Avoid over-sized managed disks
- Clean up orphaned PVCs
- Snapshot and backup retention limits enforced
- Table-level Log Analytics retention
- Filter noisy container logs
- Avoid per-pod alerting
- Separate security logs from application telemetry
- Azure budgets at subscription and resource group scope
- Cost anomaly alerts
- Policy to deny unsupported VM SKUs
- Enforce tagging for cost allocation
resource "azurerm_kubernetes_cluster_node_pool" "spot" {
name = "spotnp"
kubernetes_cluster_id = azurerm_kubernetes_cluster.aks.id
vm_size = "Standard_D4s_v5"
priority = "Spot"
eviction_policy = "Delete"
node_count = 1
}- Aggressive autoscaling can impact latency
- Spot instances require workload resilience
- Reduced log retention limits forensic depth
Cost optimization in AKS is an architectural discipline, not a post-facto exercise. By aligning node pools to workloads, enforcing autoscaling, controlling egress and telemetry, and codifying guardrails with Terraform and Azure Policy, teams can operate cost-efficient AKS platforms without sacrificing reliability or security.