Skip to content

Latest commit

 

History

History

aks-open-service-mesh-terraform

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Azure Kubernetes Service with Open Service Mesh and Terraform

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

Requirements

Deploy Azure Resources using Terraform

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.

Validate the deployment

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

Next steps

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.

Clean up resources

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