This repo is used for our Azure Kubernetes Service Labs mostly in the Microsoft Reactor and Hashicorp community group
- Hasicorp Community - Creating an AKS Cluster with Terraform
- Implementing Azure Front Door with Multi-Region AKS Clusters - Part 1
- Implementing Azure Front Door with Multi-Region AKS Clusters - Part 2
- Mircosoft Reactor Lab - Deploying .NET 5 Microservices to AKS
https://azure.microsoft.com/en-us/free/
If you look at the src/provider.tf file. you will see that we are using an Azure backend to store state. If you want an Azure backend you can add a storage account with the commands below otherwise remove the backend params and you can use local state.
Export variable with your own distinct name
export STORAGE_ACCOUNT_NAME=aksreactorlab123
Create Resource Group
az group create --location australiaeast --name terraformstate
Create Storage Account
az storage account create --name $STORAGE_ACCOUNT_NAME --resource-group terraformstate --location australiaeast --sku Standard_LRS
Create Storage Container
az storage container create --name reactorlab --account-name $STORAGE_ACCOUNT_NAME
Now the Storage account and container are created you need to update the terraform provider.tf with the values (storage_account_name, and container_name)
-
Terraform init
terraform init -var-file=deployment/devops.tfvars -backend-config="resource_group_name=Ortelius-administrator" -backend-config="storage_account_name=orteliusinfrastate" -backend-config="container_name=prod" -backend-config="key=prod.tfstate"
-
Terraform Plan
terraform plan -var-file=deployment/devops.tfvars
-
Terraform Apply
terraform apply -var-file=deployment/devops.tfvars