Cluster upgrade

Before you upgrade the cluster, make sure your subscription has enough resources, since nodes will be replaced by rolling deployments. The additional node will be added to the cluster. To check the quota limit, use the az vm list-usage --location $location command.

Let's see which Kubernetes version we're using:

# az aks show --resource-group devops --name myAKS | jq .kubernetesVersion
"1.9.11"

The Azure CLI provides the get-upgrades subcommand to check which version the cluster can upgrade to:

# az aks get-upgrades --name myAKS --resource-group devops
{
"agentPoolProfiles": [
{
"kubernetesVersion": "1.9.11",
"name": null,
"osType": "Linux",
"upgrades": [
"1.10.8",
"1.10.9"
]
}
],
"controlPlaneProfile": {
"kubernetesVersion": "1.9.11",
"name": null,
"osType": "Linux",
"upgrades": [
"1.10.8",
"1.10.9"
]
},
"id": "/subscriptions/f825790b-ac24-47a3-89b8-9b4b3974f0d5/resourcegroups/devops/providers/Microsoft.ContainerService/managedClusters/myAKS/upgradeprofiles/default",
"name": "default",
"resourceGroup": "devops",
"type": "Microsoft.ContainerService/managedClusters/upgradeprofiles"
}

This shows that we can upgrade to versions 1.10.8 and 1.10.9. In Azure, minor versions cannot be skipped, meaning we can't upgrade from 1.9.11 to 1.11.x. We have to upgrade the cluster to 1.10 first, and then upgrade to 1.11. Upgrading from AKS is extremely easy, just like from GKE. Let's say that we want to upgrade to 1.10.9:

# az aks upgrade --name myAKS --resource-group devops --kubernetes-version 1.10.9

After the operation is done, we can check the current version of the cluster. The cluster has now been upgraded to the desired version:

# az aks show --resource-group devops --name myAKS --output table
Name Location ResourceGroup KubernetesVersion ProvisioningState Fqdn
------ ---------- --------------- ------------------- ------------------- ----------------------------------------------------
myAKS centralus devops 1.10.9 Succeeded myaks-devops-f82579-077667ba.hcp.centralus.azmk8s.io

The nodes should be upgraded to 1.10.9 as well:

# kubectl get nodes
NAME STATUS ROLES AGE VERSION
aks-nodepool1-37748545-2 Ready agent 6m v1.10.9
aks-nodepool1-37748545-3 Ready agent 6m v1.10.9
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset