簡體   English   中英

在不停機的情況下升級 Azure AKS

[英]Upgrading Azure AKS without downtime

我一直在尋找無需停機即可升級 Azure AKS 的 k8s 版本的方法,並發現了這篇令人驚嘆的博客文章https://omichels.github.io/zerodowntime-aks.html但我只在開始時出錯

因此,目前在我所在地區運行的 k8s 版本不再可用。 當我嘗試創建臨時節點池時出現以下錯誤

(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

如何實現零停機升級?

下面是我不停機升級的方法,供大家參考。

  1. 僅升級控制平面。 (可在azure傳送門完成) 在此處輸入圖像描述

  2. 添加一個新的節點池。 現在新節點池的版本更高(與控制平面相同)。 然后向其中添加一個 label ,例如nodePool=newNodePool

  3. 將所有應用程序修補到新的節點池。 (通過節點選擇器)

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

  4. 檢查 Pod 是否已安排到新節點池。

    $ kubectl get pods -owide

  5. 刪除舊節點池。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM