Skip to content

Azure Kubernetes Cluster

How to create AKS:

Install Az-cli.

Tip: If you're gonna be using azure databases - create them first.

Login

Bash
az login --scope https://management.core.windows.net//.default

Create Cluster

Bash
az aks create \
    --resource-group GroupName \
    --name ClusterName \
    --node-count 2 \
    --ssh-key-value /home/user/.ssh/ssh-azure.pem \
    --attach-acr azureDockerReponame

Connect to cluster

Bash
az aks get-credentials --resource-group GroupName --name ClusterName

Show nodeResourceGroup

Bash
az aks show --resource-group GroupName --name ClusterName --query nodeResourceGroup -o tsv

az aks nodepool commands

https://learn.microsoft.com/en-us/cli/azure/aks/nodepool?view=azure-cli-latest

Create Nodepool (nodes)

Bash
az aks nodepool add -g GroupName -n worker1 --cluster-name ClusterName --os-sku Ubuntu --node-vm-size standard_b2ms --node-count 1

Delete Nodepool

Bash
az aks nodepool delete -g GroupName -n worker1 --cluster-name ClusterName

Scale Nodepool

Bash
az aks nodepool scale --cluster-name somecluster-prod -n b2msnodes -g resGroup --node-count 3
Back to top