Upgrading Azure AKS without downtime

Viewed 914

I was looking for method to upgrade k8s version without downtime for Azure AKS and found this amazing blog post https://omichels.github.io/zerodowntime-aks.html but I got error at the start only

So currently running version of k8s in my region is no more available. When I tried to create a temporary nodepool got below error

(AgentPoolK8sVersionNotSupported) Version 1.19.6 is not supported in this region. 
Please use [az aks get-versions] command to get the supported version list in this region. 
For more information, please check https://aka.ms/supported-version-list

What can I do to achieve zero downtime upgrade?

1 Answers

Here is how I upgraded without downtime, for your reference.

  1. Upgrade control plane only. (Can finish it on azure portal)enter image description here

  2. Add a new Node pool. Now the version of new node pool is higher(same with control plane). Then add a label to it, e.g. nodePool=newNodePool.

  3. Patch all application to the new node pool. (By nodeSelector)

    $ kubectl get deployment -n {namespace} -o name | xargs kubectl patch -p "{\"spec\":{\"template\":{\"spec\":{\"nodeSelector\":{\"nodePool\":\"newNodePool\"}}}}}" -n {namespace}

  4. Check the pods if are scheduled to the new node pool.

    $ kubectl get pods -owide

  5. Delete the old node pool.

Related