This directory holds Terraform configuration files for deploying an AKS cluster with the Open Service Mesh add-on enabled. It is an alternative to deploying with Azure Bicep
- An Azure Subscription (e.g. Free or Student account)
- The Azure CLI
- Bash shell (e.g. macOS, Linux, Windows Subsystem for Linux (WSL), Multipass, Azure Cloud Shell, GitHub Codespaces, etc)
- The Terraform CLI
Terraform will use your Azure CLI login context to deploy the resources into your subscription.
Login to the Azure CLI.
az login
Optionally set the correct subscription if you have more than one. You can list them via az account list
.
az account set -s '<YOUR_SUBSCRIPTION_NAME>'
Change to the cloud-native/aks-open-service-mesh-terraform
subdirectory of this repo and run the Terraform deployment script.
cd cloud-native/aks-open-service-mesh-terraform
terraform init
terraform apply
Terraform state files will be stored locally within your current directory; however, best practice is to store your Terraform state files in Azure Storage or Terraform Cloud.
Once you've completed the deployment of Azure infrastructure, run the following command to set the random deployment name to an environment variable.
export name=$(terraform output -raw random_pet_name)
Authenticate kubectl
against the AKS cluster with the following command.
az aks get-credentials \
--resource-group "rg-${name}" \
--name "aks-${name}"
Validate access to your AKS cluster using kubectl
.
kubectl get nodes -o wide
Continue on to the Validate OSM resources and configurations portion of the Azure Kubernetes Service with Open Service Mesh lab to deploy workloads to your cluster.
NOTE: In your terminal you should perform
cd ../aks-open-service-mesh
to be in the proper directory to complete the rest of the lab.
Once you have finished exploring Azure Kubernetes Service with Open Service Mesh and Terraform, you should delete the deployment to avoid any further charges.
Run the destroy
command to delete all your resources.
terraform destroy