In this article, We will see how to create AKS cluster using Hashicorp Terraform
Azure Kubernetes Service (AKS) is a highly available, secure, and fully managed Kubernetes service of Microsoft Azure.
AKS is a fully managed service from Microsoft that is highly available and secure.
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 important 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.
Before we begin developing clusters and utilizing Terraform, we have to deploy the Azure CLI.
You can locate the respectable documentation on putting in the Azure CLI here.
Follow the instructions here to set up Terraform. When you’re done, we need to be in a position to run the terraform command:
We want to create the service principal, for that Kindly run following command in CMD.
Terraform tracks state locally by means of the
terraform.tfstate file. This pattern works well in a standalone environment. However, in a business enterprise environment, we need to track state using
Use below option to create an Azure storage account and container:
We have created the following resources to create AKS.
- Terraform hooked up in the machine
- Azure Service Principal – To create the azure k8s
- Azure Storage and containers – To keep tfstate file
Before we execute the terraform, We will create a git repository. Once the repository is ready, create following files,
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.