Provision the kubernetes cluster baseline¶
We will configure the kubernetes cluster via OpenTofu.
The source code can be found in the azure-bank-infrastructure repository.
Prerequisites¶
Infrastructure:
- AKS is created from previous step
User:
- Same as previous step
contributor permissions on Azure subscription where will be hosted the cluster
contributor permissions on Azure container registry if in a different subscription
OpenTofu cli installed (we recommend to use tenv as version manager to install it and keep up-to-date it)
Resources to be created¶
- namespaces
- a set of roles to manage access to the namespaces for users
- network policies
Run OpenTofu¶
Note: Before running the code make sure to set to false the below variables in the tfvars file:
- deploy_certificates
You will also need to add the cluster to your kube config file and add private endpoint ip in our hosts file.
## Add the new cluster to your Kubernetes config
az aks get-credentials --name <cluster-name> --resource-group <rg-name>
Run afterwards the following commands
cd <path_to_folder>
tofu init -var-file dev.tfvars
tofu plan -var-file dev.tfvars
tofu apply -var-file dev.tfvars