In this course, we're going to deploy AKS clusters using different Infrastructure as Code approaches. Some of the key topics that we'll cover include:
Creating a cluster with Azure CLI
Using the Azure CLI in an idempotent way, so you can run and re-run the code without generating warnings and errors
We'll switch to using Terraform, and see how useful the module for Azure AKS is, which may be all you need to spin up some test clusters
We'll spend the bulk of the course on walking through the AKS Baseline Cluster from the Azure Architecture Centre, but converted from a massive Azure Bicep file into individual Terraform resources which are considerably easier to understand. This will enable you to use Terraform variables to toggle the creation of the resources you need in your own context.
Launch your first AKS cluster in 15 minutes with Azure CLI. We turn the steps in the Azure quickstart tutorial into idempotent bash shell scripts, so you can run them again and again. We'll run through the full process, including deploying an application to the cluster, and then deleting the cluster, resource group and Kubernetes context.
Create an Azure storage account and container to store Terraform state. We'll use bash shell scripts to wrap Azure CLI commands to create a backend for Terraform, and set up the storage firewall to allow access from your IP address.
Create the Minimum Viable Product in Terraform - using a remote backend to maintain state, take an Azure resource group through the Terraform lifecycle of init, plan, apply, destroy.
A cluster in 15 minutes - this time via Terraform. Use the official Azure Terraform Module to create a cluster in minutes. Similar to creating a cluster with Azure CLI, the Terraform code will create a resource group, virtual network, subnet, and AKS cluster.
Split code into subscription, hub, spoke, and cluster. Use Terraform's count keyword, combined with boolean variables to control the creation of resources. Prepare your code for production by a separation of concerns into hub and spoke networking, and choose whether to use the expensive Azure Firewall for your outbound routing.