Azure Kubernetes Service Module Architecture
| Component | Resource Type | Purpose | Configuration |
|---|---|---|---|
| AKS Cluster | azurerm_kubernetes_cluster | Managed Kubernetes control plane + default node pool | Private, Standard SKU, SystemAssigned identity |
| Additional Node Pools | azurerm_kubernetes_cluster_node_pool | User workload node pools (GPU, spot, memory-optimized) | for_each map, auto-scaling, taints/labels |
| ACR Pull Role | azurerm_role_assignment | Grants kubelet identity AcrPull on Container Registry | Conditional on acr_id |
| Network Profile | Inline block | Azure CNI Overlay + Cilium eBPF | Pod CIDR 10.244.0.0/16, Service CIDR 10.0.0.0/16 |
| Workload Identity | Inline feature | OIDC-based pod identity federation | Enabled by default |
| Key Vault CSI | Inline add-on | Mount Key Vault secrets into pods | Secret rotation every 2m |
| Defender | Inline block | Runtime threat detection for containers | Requires Log Analytics |
| Maintenance Window | Inline block | Scheduled cluster maintenance | Allowed/not-allowed windows |
| Control | Implementation | Default |
|---|---|---|
| Private Cluster | API server accessible only within VNet | Enabled |
| RBAC | Kubernetes RBAC + Azure AD RBAC | Enabled (always on) |
| Workload Identity | OIDC issuer + federated credentials | Enabled |
| Network Policy | Cilium eBPF-based pod network policies | Cilium |
| Microsoft Defender | Runtime threat detection, vulnerability scanning | Enabled |
| Azure Policy | Enforce organizational standards on clusters | Enabled |
| Key Vault Integration | CSI driver with secret rotation (2m) | Enabled |
| Image Cleaner | Automatic stale image cleanup (48h) | Enabled |
| API Server Access | Authorized IP ranges whitelist | Optional |
| Capability | Healthcare | Finance | Government | Retail | SaaS |
|---|---|---|---|---|---|
| Private Cluster | ✓ | ✓ | ✓ | ✓ | ✓ |
| Azure Policy | ✓ HIPAA | ✓ PCI-DSS | ✓ FedRAMP | ✓ | ✓ |
| Defender | ✓ | ✓ | ✓ | ✓ | ✓ |
| Workload Identity | ✓ | ✓ | ✓ | ✓ | ✓ |
| Network Policy | ✓ | ✓ | ✓ | ✓ | ✓ |
| Multi-AZ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Audit Logging | ✓ | ✓ | ✓ | Optional | Optional |
| Variable | Type | Default | Description |
|---|---|---|---|
cluster_name | string | required | Name of the AKS cluster |
kubernetes_version | string | required | Kubernetes version |
vnet_subnet_id | string | required | Subnet ID for default node pool |
private_cluster_enabled | bool | true | Enable private API server |
sku_tier | string | Standard | Free, Standard, or Premium |
network_policy | string | cilium | Network policy engine |
default_node_pool | object | required | System node pool configuration |
additional_node_pools | map(object) | {} | User node pools map |
enable_workload_identity | bool | true | Workload identity federation |
enable_defender | bool | true | Microsoft Defender for Containers |
acr_id | string | null | ACR ID for AcrPull role |
# Initialize terraform init # Plan terraform plan -out=tfplan \ -var="cluster_name=my-aks" \ -var="resource_group_name=rg-aks" \ -var="location=eastus" \ -var="kubernetes_version=1.29" \ -var="dns_prefix=myaks" \ -var='vnet_subnet_id=/subscriptions/.../subnets/aks' # Apply terraform apply tfplan # Get credentials az aks get-credentials --resource-group rg-aks --name my-aks
Azure AKS Documentation | Terraform AKS Resource | Module README | Examples