Hands-onLesson 14 of 16

Hands-on: Provision AKS Platform Stack

Combine the earlier lessons into a realistic AKS-ready Terraform composition with shared foundation, registry, identity, and cluster outputs that later pipelines can use.

🎯 Lab Goal

Provision a simplified but realistic AKS platform stack using Terraform modules or layered files, then map where AKS operations, Helm installs, and CI/CD release workflows connect.

🧱 Suggested Stack

Platform Composition
network module
acr module
aks module

🛠️ Lab Steps

  1. Reuse the foundation network from the previous lab.
  2. Create an Azure Container Registry.
  3. Provision an AKS cluster attached to the AKS subnet.
  4. Output cluster and registry details for later use.
  5. Document which next steps move to the AKS, Helm, and Azure DevOps courses.

Example ACR + AKS Resources

hcl
resource "azurerm_container_registry" "platform" {
  name                = "acrplatformdev001"
  resource_group_name = azurerm_resource_group.platform.name
  location            = azurerm_resource_group.platform.location
  sku                 = "Premium"
  admin_enabled       = false
}

resource "azurerm_kubernetes_cluster" "platform" {
  name                = "aks-platform-dev"
  location            = azurerm_resource_group.platform.location
  resource_group_name = azurerm_resource_group.platform.name
  dns_prefix          = "aksplatformdev"

  default_node_pool {
    name           = "system"
    node_count     = 2
    vm_size        = "Standard_D4s_v5"
    vnet_subnet_id = azurerm_subnet.aks.id
  }

  identity {
    type = "SystemAssigned"
  }
}

Useful Outputs

hcl
output "aks_cluster_name" {
  value = azurerm_kubernetes_cluster.platform.name
}

output "acr_login_server" {
  value = azurerm_container_registry.platform.login_server
}

🔗 How This Connects to Other Modules

🐛 Break/Fix Exercises

📋 Interview Questions

Scenario Practice

Why should AKS infrastructure outputs be stable?

Because later deployment pipelines and platform consumers depend on those outputs as contracts.

What belongs in Terraform here versus Helm later?

Terraform provisions the Azure infrastructure and cluster. Helm handles Kubernetes application packaging and release management after the cluster exists.

What is the most important review focus before applying this lab to production?

Networking, identity, replacement risk, quotas, and whether the cluster settings match the intended production operating model.

🧾 Summary

This lab turns Terraform concepts into a platform stack that other SKILLY modules can build on. It is the bridge between infrastructure provisioning and full platform delivery.