Terraform AKS baseline clusters - deployment walkthrough

Use Azure CLI and Terraform to deploy a baseline AKS cluster in hours not days - full end-to-end walkthrough

Ratings: 3.94 / 5.00




Description

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.

What You Will Learn!

  • Create AKS clusters with Azure CLI and Terraform CLI
  • Be able to deploy an AKS baseline cluster based on the reference from Azure Architecture Center
  • Understand how (and where) to change Terraform variables to configure the cluster
  • How to wrap Azure CLI in bash shell scripts to make it idempotent

Who Should Attend!

  • Cloud Engineer with experience on a different public cloud, or bare metal. You've worked with managed Kubernetes on a different cloud provider (AWS EKS, Google GKE, Oracle OKE) and want to get up to speed on AKS quickly
  • Developer / DevOps. You want to better understand the infrastructure where your application runs, to make being on-call a nicer experience
  • IT Operations. You know other Azure services, but haven't worked with AKS.
  • Network Engineer. You come from a classical networking background, working with routers and switches, but you're being asked questions about Azure's Virtual Networks, route tables, and Azure Firewall.