- Lab
- A Cloud Guru
Create an AKS Cluster and Deploy Applications
Welcome to the Create an AKS Cluster and Deploy Applications lab. In this lab, we will cover four objectives: 1. Create a VNet for an AKS Cluster 1. Create an AKS Cluster 1. Deploy Flux CD Using Helm 1. Deploy an Application Using Flux CD By the end of this lab, you will have successfully created an AKS cluster using Terraform and deployed an application using Flux CD.
Path Info
Table of Contents
-
Challenge
Create a VNet for an AKS Cluster
In this objective, you will create a Virtual Network (VNet) that will be used by the AKS cluster in a resource group provided by the lab. The VNet will have an address space of
10.64.0.0/16
and two subnets:- ingress: "10.64.4.0/24"
- nodes: "10.64.0.0/22"
- Login into the Azure CLI using the provided credentials.
- Retrieve the resource group name from the lab.
- Create a new Terraform configuration with the resource group as a data source.
- Add the desired VNet using the VNet module.
- Deploy the VNet using Terraform.
-
Challenge
Create an AKS Cluster
In this objective, you will create an AKS cluster using Terraform. The AKS cluster will be created in the resource group provided by the lab and will use the VNet created in the previous objective. The AKS cluster has the following requirements:
- Sku tier: Standard
- Kubernetes version: latest
- Upgrades: Automatic and Node Image OS
- Log analytics: Disabled
- System nodes: 2
- System node size: Standard_D2s_v3
- Network plugin: Azure CNI
- Network policy: Azure
- Load balancer: Standard
- Node pools: 1
- Node pool count: 1
- Node pool VM size: Standard_D2s_v3
- RBAC: enabled, no Entra ID/Azure AD integration
- Add an AKS cluster to the existing configuration using the AKS module and the VNet provisioned in the previous objective.
- Configure the arguments of the module to match the cluster requirements.
- Add outputs for the following: cluster FQDN, client certificate, client key, and cluster CA certificate.
- Deploy the AKS cluster and validate the deployment.
-
Challenge
Deploy Flux CD Using Helm
In this objective, you'll use the Helm provider to deploy Flux CD to the AKS cluster. The installation process can be found in this guide for the Flux provider.
- Add the Helm provider to your configuration.
- Configure the Helm providers with credentials from the AKS cluster.
- Add a
helm_release
resource to deploy theflux2
chart to the AKS cluster. - Confirm that Flux CD has been installed successfully on the cluster.
-
Challenge
Deploy an Application Using Flux CD
In this objective, you will create a new Terraform configuration that deploys this sample application using Flux CD and the Kubernetes provider. Refer to the Flux CD documentation for manifest examples.
- Create a new Terraform configuration using the Kubernetes provider.
- Use the
terraform_remote_state
data source to access the outputs of the cluster deployment. - Configure the Kubernetes provider with the values from the
terraform_remote_state
data source. - Create
kubernetes_manifest
resources for the following:- Flux GitRepository - Use this repository: https://github.com/ned1313/taco-fleet
- Flux Kustomization - Targeting the
infrastructure
directory of the repository - Flux Kustomization - Targeting the
dotnet-lb
directory of the repository
- Deploy the manifests using Terraform.
- Verify application deployment and access through the public IP address on the load balancer.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.