Azure-AKS ¶
Cluster.dev uses stack templates to generate users' projects in a desired cloud. Azure-AKS is a stack template that creates and provisions Kubernetes clusters in Azure cloud by means of Azure Kubernetes Service (AKS).
On this page you will find guidance on how to start an AKS cluster on Azure using one of the Cluster.dev prepared samples – the Azure-AKS stack template. Running the example code will have the following resources created:
-
Azure DNS Zone
-
Azure Virtual Network
-
AKS Kubernetes cluster with addons:
-
cert-manager
-
ingress-nginx
-
external-secrets (with Azure Key Vault backend)
-
external-dns
-
argocd
-
Prerequisites ¶
-
Terraform version 1.4+
-
Azure account and a subscription
-
Azure CLI installed and configured with your Azure account
-
kubectl installed
-
Parent Domain
Quick Start ¶
-
Clone example project:
-
Update
project.yaml
: -
Create the Azure Storage Account and a container for Terraform backend:
-
It may be necessary to assign the
Storage Blob Data Contributor
andStorage Queue Data Contributor
roles to your user account for the storage account:STORAGE_ACCOUNT_ID=$(az storage account show --name cdevstates --query id --output tsv) USER_OBJECT_ID=$(az ad signed-in-user show --query id --output tsv) az role assignment create --assignee "$USER_OBJECT_ID" --role "Storage Blob Data Contributor" --scope "$STORAGE_ACCOUNT_ID" az role assignment create --assignee "$USER_OBJECT_ID" --role "Storage Queue Data Contributor" --scope "$STORAGE_ACCOUNT_ID"
-
Edit variables in the example's files, if necessary.
-
Run
cdev plan
-
Run
cdev apply
-
Set up DNS delegation for the subdomain by creating NS records for the subdomain in parent domain. Run
cdev output
Add records from thedomain = demo.azure.cluster.dev. name_servers = [ "ns1-36.azure-dns.com.", "ns2-36.azure-dns.net.", "ns3-36.azure-dns.org.", "ns4-36.azure-dns.info." ]
name_server
list. -
Connect to AKS cluster. Run
cdev output
Execute the command inkubeconfig_cmd = az aks get-credentials --name <aks-cluster-name> --resource-group <aks-cluster-resource-group> --overwrite-existing
kubeconfig_cmd
-
Retrieve the ArgoCD admin password:
Destroy sample architecture ¶
-
Run
cdev destroy
-
Remove NS records for subdomain in parent domain.
-
Delete Azure Storage Account and a container for Terraform backend: