Skip to content

Instantly share code, notes, and snippets.

@dejanu
Last active May 5, 2022 16:01
Show Gist options
  • Save dejanu/c0a43bc74197edf0478181f4d446869a to your computer and use it in GitHub Desktop.
Save dejanu/c0a43bc74197edf0478181f4d446869a to your computer and use it in GitHub Desktop.
Upgrade an Azure Kubernetes Service (AKS) cluster
# get available k8s versions for AKS, e.g. for location westeurope
az aks get-versions --location westeurope | jq ".orchestrators[] | .orchestratorVersion"
# get available versions for your AKS
az aks get-upgrades --resource-group <resourcegroup_name> --name <aks_name> --output table
# check your k8s version for control plane and woker node pool
az aks show -g <resourcegroup_name> -n <resourcegroup_name>| grep -E "orchestratorVersion|kubernetesVersion"
# update max-surge to 3 nodes, you can use percentage also e.g.50% (for a node surges half of the no of nodes from the node pool)
az aks nodepool update -n <nodepool_name> -g <resourcegroup_name> --cluster-name <aks_name> --max-surge 3
# upgrade to the desire k8s version
az aks upgrade --resource-group <resourcegroup_name> --name <aks_name>--kubernetes-version <desired_k8s_version>
# confirm upgrade and check cluster state
az aks show --resource-group <resourcegroup_name> --name <aks_name> --output table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment