Hands-on project demonstrating deployment of an Azure Kubernetes Service (AKS) cluster using Terraform from macOS.
Covers provisioning, validation, troubleshooting, and teardown for cost-free lifecycle management.
| Tool | Version | Purpose |
|---|---|---|
| macOS | Sonoma | Local dev environment |
| Terraform | 1.13.5 | IaC engine |
| Azure CLI | 2.79.0 | Auth & provisioning |
| kubectl | 1.32.9 | Cluster validation |
| Git + SSH | latest | Source control & automation |
-
Initialize project
brew install terraform azure-cli kubectl git az login terraform init
-
Define infrastructure in
main.tf- Resource Group →
rg-lab - AKS Cluster →
aks-lab - Managed identity + node pool
- Resource Group →
-
Deploy
terraform plan terraform apply
-
Validate cluster
az aks get-credentials --resource-group rg-lab --name aks-lab kubectl get nodes
-
Destroy to avoid costs
terraform destroy
| Error | Cause | Fix |
|---|---|---|
| Plugin did not respond | Provider init glitch | Re-terraform init + re-auth |
az: executable not found |
CLI missing | brew install azure-cli |
| File > 100 MB push fail | Provider cached | Add .terraform/ to .gitignore |
| APFS mount error | Container mis-mounted | Erased via Disk Utility → APFS Container 1 |
.gitignoreexcludes.terraform/, state, logs, and creds.- Used SSH auth → no plaintext tokens.
- Confirmed teardown with
az group list.
- AKS teardown ≈ 4 min avg (async Azure cleanup).
- Keep state files local or encrypted remote.
- Terraform + AKS demonstrates real-world cloud automation flow.
aks-lab/
├── main.tf
├── .gitignore
├── README.md
├── RUNBOOK.md
└── gitcheck.sh
PruSystems
📧 [email protected]
🌐 prusystems.com
💻 github.com/prusystems