# Launching an AKS cluster

Below we describe how we can launch and use Kontain in an Azure AKS (Kubernetes) cluster.

# Starting up an AKS cluster

# Pre-requisites

  • Install Azure CLI,
  • Create an Azure AKS account
  • Verify that you are able to use the Azure CLI to login to AKS:
az login --service-principal -u <app-id> -p <password-or-cert> --tenant <tenant>

or

az login -u <username> -p <password>

and, only once, set your subscription to ensure that you are using the right one for your cluster

az account set --subscription "<your-subscription-id>"

Note: Follow instructions in Sign in with Azure CLI if you have any issues or questions

# Create cluster using Kontain helper script

Download helper script and make sure it is executable

curl -o aks-cluster.sh https://raw.githubusercontent.com/kontainapp/k8s-deploy/master/helpers/aks-cluster.sh
chmod +x aks-cluster.sh

Run script using your credentials. Make sure to set region and prefix to your desired values. The script will create AKS cluster with the name <prefix>-aks-cluster. All other associated recource names are prefixed with <prefix>.

aks-cluster.sh  --tenant=TENANT_ID --app-id=AZURE_APP_ID --password=AZURE_SECRET --region=<your region> <prefix>

# Verify your cluster was created

az aks list -o table

# Enable and Test Kontain Runtime

Please refer to: Install Kontain in Kubernetes

# Clean up

To delete cluster and all associated resources use the following

aks-cluster.sh  --tenant=TENANT_ID --app-id=AZURE_APP_ID --password=AZURE_SECRET --region=<your region> <prefix> --cleanup