简体   繁体   English

在不停机的情况下升级 Azure AKS

[英]Upgrading Azure AKS without downtime

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我一直在寻找无需停机即可升级 Azure AKS 的 k8s 版本的方法,并发现了这篇令人惊叹的博客文章https://omichels.github.io/zerodowntime-aks.html但我只在开始时出错

So currently running version of k8s in my region is no more available.因此,目前在我所在地区运行的 k8s 版本不再可用。 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?如何实现零停机升级?

Here is how I upgraded without downtime, for your reference.下面是我不停机升级的方法,供大家参考。

  1. Upgrade control plane only.仅升级控制平面。 (Can finish it on azure portal) (可在azure传送门完成) 在此处输入图像描述

  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, eg nodePool=newNodePool .然后向其中添加一个 label ,例如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.检查 Pod 是否已安排到新节点池。

    $ kubectl get pods -owide

  5. Delete the old node pool.删除旧节点池。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM