This project provides a step-by-step guide to provisioning an AKS cluster on Azure using Terraform and Azure DevOps pipelines.
- Terraform installed
- An Azure subscription
- A service principal with sufficient permissions
- Azure DevOps organization and project
- Access to an Azure subscription
- Existing Azure resource group
- Azure Key Vault with stored client ID and client secret
- Terraform
- Azure
- Azure DevOps
backend.tf
: Configuration for remote backenddata.tf
: Data sources for existing Azure resourcesmain.tf
: Main configuration file for AKS clusteroutput.tf
: Outputs from the Terraform executionprovider.tf
: Azure provider configurationvariables.tf
: Variable definitionsterraform.tfvars
: Variable valuesazure-pipelines.yml
: Azure DevOps pipeline configuration
- Uses Azure RM as the provider
- Deploys an AKS cluster with customizable settings
- Utilizes a remote backend for state management
- Implements Azure Key Vault for secure credential management
- Uses an existing resource group
- Configures service principal for Azure authentication
-
Clone the repository:
git clone <your-repo-url>
-
Configure the backend:
Update the
backend.tf
file with your remote backend configuration. -
Configure the variables in
terraform.tfvars
:cluster_name = "<your-cluster-name>" location = "<your-location>" resource_group_name = "<your-resource-group-name>" dns_prefix = "<your-dns-prefix>" node_count = <your-node-count> vm_size = "<your-vm-size>" tag = "<your-environment-tag>"
-
**Run the Infra pipeline **
Run the infra pipeline on Azure DevOps platform.
- Azure Kubernetes Service (AKS)
- Azure Resource Group (Existing)
- Azure Key Vault (for storing credentials)
This project uses Azure Key Vault to manage sensitive information. Ensure that you have the necessary permissions and that your service principal is correctly configured to access the Key Vault.