mxdara / Provisioning-AKS-with-terraform

In this project, I will create an AKS cluster using a service principal. After running Terraform plan, I'll generate the kubeconfig file and service principal, which will be stored in a key vault for later use.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provision AKS cluster using Terraform via Service Principal

In this project, I will be creating AKS cluster the right way by using service principle.kubeconfig and service principle will be generated after the terraform plan and secret will be upload to keyvault to be used further.

Below resources will be created using this terraform configuration:-

  • Resource Group
  • Service Principle
  • AKS cluster using the SPN
  • Azure key vault to store the client secret
  • Secret uploaded to key vault
  • kubeconfig for AKS

Usage/Examples

1) login to the CLI

az login --use-device-code

2) set alias

alias tf=terraform

3) initialize the providers

tf init

4) Run the plan

tf plan

5) Apply the changes

tf apply --auto-approve

Resolution:-

User should have keyvault admin role even if the user has owner role.

About

In this project, I will create an AKS cluster using a service principal. After running Terraform plan, I'll generate the kubeconfig file and service principal, which will be stored in a key vault for later use.


Languages

Language:HCL 92.0%Language:Shell 8.0%