Infrastructure / Azure / v4
Azure platform sandbox
A small Azure learning environment for Kubernetes experiments. Terraform creates the ephemeral platform; GitHub Actions starts the session and hands deployment to Argo CD.
- Terraform
- AKS
- Argo CD
- Traefik
- cert-manager
- Cloudflare DNS
- PostgreSQL
- ACR
- Planning estimate
- $20–35 USD / month, before tax
- Session target
- ~10% of the month active
- Cluster shape
- 1 node D2s v3, 100 pods
- Terraform state
- 1 / folder in Azure Blob Storage
One folder. One resource group.
- State resource group
- Blob Storage backend
- Separate state per module
- Network + subnets
- Storage + Key Vault
- Dashboard + ACR
- One AKS D2s v3 node
- 100-pod capacity
- Private PostgreSQL
Idle: only state and foundation exist. AKS creates its own node resource group when a session starts.
Start a session. Clear the cost.
Deploy a module
Each Terraform folder has its own GitHub Actions workflow and its own state blob. The backend lock protects concurrent changes, and the shared Azure name and region come from repository variables.
git push → workflow: foundation.yml → terraform apply
Create database + AKS
A manual session workflow brings up the expensive resources: a private PostgreSQL server and a single-node AKS cluster.
workflow_dispatch: session → action=start
Route it safely
Starting compute triggers Argo CD, which installs the platform through an app-of-apps configuration. Traefik receives a fresh public IP, Let’s Encrypt issues certificates, and the workflow updates the Cloudflare record automatically.
argocd → app-of-apps → traefik + cert-manager
Remove expensive resources
AKS goes first, PostgreSQL second. A scheduled cleanup runs at 08:00 UTC in case a session is forgotten.
cron: 0 8 * * * → destroy compute → destroy database
From change to session.
- Developer push
- GitHub ActionsOIDC, no stored secrets
- Terraformstate in Azure Blob
- Database + AKSsession resources
- Argo CD + HelmGitOps
- Traefik + TLS
- Cloudflare DNS
Each change goes through a focused workflow; cleanup removes the costly session resources.
Honest numbers. $20–35 is a planning estimate assuming AKS and PostgreSQL are active around 10% of the month. It is not a bill or a spending cap; Azure budget alerts notify but do not stop resources.