Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 25, 2022 10:09 pm GMT

How to create AKS using Terraform - Part 1

In this article, We will see how to create AKS cluster using Hashicorp Terraform

How to create Azure Kubernetes Service using Terraform

- How to create Azure Kubernetes Service using Terraform - Part 1
- How to create Azure Kubernetes Service using Terraform - Part 2

Azure Kubernetes Service (AKS) is a highly available, secure, and fully managed Kubernetes service of Microsoft Azure.

Azure Kubernetes Service (AKS) simplifies deploying a managed Kubernetes cluster in Azure by offloading the operational overhead to Azure. As a hosted Kubernetes service, Azure handles critical tasks, like health monitoring and maintenance. Since Kubernetes masters are managed by Azure, we only manage and maintain the agent nodes. Thus, AKS is free; we only pay for the agent nodes within our clusters, not for the masters.

Pre-requisites

Setting up the Azure account

Before we start creating clusters and utilizing Terraform, we have to install the Azure CLI.

You can find the official documentation on installing the Azure CLI here.

Terraform Installation

Follow the instructions here to install Terraform. When youre done, we should be able to run the terraform command:

terraform -version

Azure Service Principal Creation

We need to create the service principal, for that Kindly run following command in CMD.

az login

Configuring Azure storage to store Terraform state file

Terraform tracks state locally via the terraform.tfstate file. This pattern works well in a standalone environment. However, in a enterprise environment, we need to track state using Azure storage.

Use below option to create an Azure storage account and container:

Create a storage account

We have created the following resources to create AKS.

  1. Terraform installed in the machine
  2. Azure Service Principal To create the azure k8s
  3. Azure Storage and containers To store tfstate file

Before we execute the terraform, We will create a git repository. Once the repository is ready, create following files,

  • provider.tf
  • main.tf
  • variables.tf
  • outputs.tf

Kindly refer the article for How to create Azure Kubernetes Service using Terraform - Part 2

Thanks for reading my article till end. I hope you learned something special today. If you enjoyed this article then please share to your friends and if you have suggestions or thoughts to share with me then please write in the comment box.


Original Link: https://dev.to/makendrang/how-to-create-aks-using-terraform-part-1-5bkf

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To