RKE1 到 RKE2 Windows 遷移指南
注意: 本文件的內容不在 Rancher 支援的 SLA 範圍內。請謹慎進行。
本文件涵蓋最終使用者如何將其 Windows 工作負載從 RKE1 遷移到 RKE2。
RKE1 Windows 排程
RKE1 Windows 工作負載排程基於污點和容忍度。
RKE1 Windows 叢集中的每個 Linux 節點,無論分配給它什麼角色,都將具有預設污點,防止工作負載在其上排程,除非工作負載已配置容忍度。這是 RKE1 Windows 叢集的主要設計功能,這些叢集被設計為僅運行 Windows 工作負載。
- 預設 RKE1 Linux 節點
NoSchedule污點:
apiVersion: v1
kind: Node
spec:
...
taints:
- effect: NoSchedule
key: cattle.io/os
value: linux
- RKE1 Linux
NoSchedule工作負載容忍度
以下容忍度將允許最終使用者工作負載在 RKE1 Windows 叢集的任何 Linux 節點上排程。這些容忍度用於各種核心 Rancher 服務和工作負載。
apiVersion: apps/v1
kind: Deployment
spec:
...
template:
...
spec:
tolerations:
- effect: NoSchedule
key: cattle.io/os
operator: Equal
value: linux
- 符合最佳實踐,在 Linux 節點上運行的任何最終使用者工作負載將僅排程到具有工作節點角色的節點上:
apiVersion: apps/v1
kind: Deployment
spec:
...
template:
...
spec:
tolerations:
- effect: NoSchedule
key: cattle.io/os
operator: Equal
value: linux
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: node-role.kubernetes.io/worker
operator: In
values:
- "true"
weight: 100
...
RKE2 Windows 排程
基於反饋和對混合工作負載支援的請求,RKE2 Windows 被設計為預設支援 Linux 和 Windows 工作負載。RKE2 排程預設依賴於節點選擇器。這與 RKE1 有明顯的不同,因為污點和容忍度沒有納入 RKE2。節點選擇器是 RKE1 Windows 叢集的關鍵部分,這使得您的工作負載遷移變得容易。
遷移範例
RKE1 到 RKE2 Windows 工作負載
- 遷移前的 RKE1 Windows 部署:
apiVersion: apps/v1
kind: Deployment
spec:
...
template:
...
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: NotIn
values:
- linux
- 使用
NodeAffinity遷移的 RKE2 Windows 部署:
apiVersion: apps/v1
kind: Deployment
...
spec:
...
template:
...
spec:
...
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- windows
RKE1 Windows 叢集純 Linux 部署
重要: 使用節點選擇器和節點親和性時,請注意以下事項:
- 如果同時指定
nodeSelector和nodeAffinity,則兩者都必須滿足才能將Pod排程到節點上。- 如果您指定與單個
nodeSelectorTerms關聯的多個matchExpressions,則只有在滿足所有matchExpressions時才能將Pod排程到節點上。
- 遷移前的 RKE1 Windows 叢集純 Linux 部署,目標為 RKE1 Linux 工作節點:
apiVersion: apps/v1
kind: Deployment
spec:
...
template:
...
spec:
tolerations:
- effect: NoSchedule
key: cattle.io/os
operator: Equal
value: linux
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: node-role.kubernetes.io/worker
operator: In
values:
- "true"
- 使用節點選擇器遷移的 RKE2 混合叢集純 Linux 部署,目標為 RKE2 Linux 工作節點:
apiVersion: apps/v1
kind: Deployment
spec:
...
template:
...
spec:
nodeSelector:
kubernetes.io/os: "linux"
node-role.kubernetes.io/worker: "true"
- 使用節點親和性遷移的 RKE2 混合叢集純 Linux 部署,目標為 RKE2 Linux 工作節點:
apiVersion: apps/v1
kind: Deployment
spec:
...
template:
...
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: node-role.kubernetes.io/worker
operator: In
values:
- "true"
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- linux
RKE1 支援的 Windows Server 版本
長期服務通道(LTSC)
- Windows Server 2019 LTSC ✅ 將於 2024 年 1 月 9 日達到主流 EOL,並於 2029 年 1 月 9 日達到延長 EOL
半年通道(SAC)
- Windows Server 20H2 SAC ❌ 已於 2022 年 8 月 9 日達到 EOL
- Windows Server 2004 SAC ❌ 已於 2021 年 12 月 14 日達到 EOL
- Windows Server 1909 SAC ❌ 已於 2021 年 5 月 11 日達到 EOL
- Windows Server 1903 SAC ❌ 已於 2020 年 12 月 8 日達到 EOL
- Windows Server 1809 SAC ❌ 已於 2020 年 11 月 10 日達到 EOL
RKE2 支援的 Windows Server 版本
RKE2 中的長期服務通道
- Windows Server 2019 LTSC ✅ 將於 2024 年 1 月 9 日達到主流 EOL,並於 2029 年 1 月 9 日達到延長 EOL
- Windows Server 2022 LTSC ✅ 將於 2026 年 10 月 13 日達到主流 EOL,並於 2031 年 10 月 13 日達到延長 EOL
注意: RKE2 不支援 SAC。
有關更多資訊,請參閱以下參考資料:
Kubernetes 版本支援
注意: 下面列出的所有版本都 按照 Rancher v2.6.7 支援矩陣在 SLA 下受支援。任何未列出的版本都應假定為 EOL,不在 SUSE 的 SLA 支援範圍內。
Rancher 2.5 與 Rancher 2.6 Windows 叢集支援矩陣
RKE1 與 RKE2 Windows 叢集支援的 Kubernetes 版本:
| Kubernetes 版本 | RKE1 | RKE2 |
|---|---|---|
| 1.18 | ✓ | |
| 1.19 | ✓ | |
| 1.20 | ✓ | |
| 1.21 | ✓ | |
| 1.22 | ✓ | ✓ |
| 1.23 | ✓ | |
| 1.24 | ✓ | |
| 1.25+ | ✓ |
Rancher 2.5 與 Rancher 2.6 佈建 RKE1 和 RKE2 Windows 叢集支援的 Kubernetes 版本
| Rancher 版本 | Kubernetes 版本 | RKE1 | RKE2 |
|---|---|---|---|
| 2.5 - RKE1 佈建 | 1.18 1.19 1.20 | ✓ | |
| 2.6 - RKE1 佈建 | 1.18 1.19 1.20 1.21 1.22 | ✓ | |
| 2.6 - RKE2 佈建 | 1.22 1.23 1.24 1.25+ | ✓ |
將工作負載遷移到 RKE2 Windows 的指南
參考 Rancher 2.5 與 Rancher 2.6 Windows 叢集支援矩陣和 Rancher 2.5 與 Rancher 2.6 佈建 RKE1 和 RKE2 Windows 叢集支援的 Kubernetes 版本中的表格,您會發現 RKE1 和 RKE2 之間的 Kubernetes 版本重疊發生在 1.22。這將是遵循 Rancher 推薦方法時遷移 RKE1 Windows 工作負載所需的基礎版本。
Rancher 2.5 的就地升級
- 將 Rancher 版本升級到 v2.6.5+。
- 使用最新可用的修補程式版本將 RKE1 Windows 下游叢集升級到 RKE1 v1.22。
- 使用 RKE1 Windows 叢集所在的匹配修補程式版本,使用 RKE2 v1.22 佈建一個新的 RKE2 Windows 下游叢集。
- 開始將 Windows 工作負載從 RKE1 遷移到 RKE2 叢集。
- 執行驗證測試以確保在將應用程式從 RKE1 遷移到 RKE2 時沒有功能損失或變更。
- 成功進行驗證測試後,您可以選擇將 RKE2 1.22.x 叢集升級到新的次要版本,例如 1.23 或 1.24。
將 Windows 工作負載遷移到新的 Rancher 環境
重要: 要執行以下任一選項需要 Rancher v2.6.5 或更高版本。
當 RKE1 和 RKE2 使用匹配的 Kubernetes 修補程式版本時:
- 使用 RKE1 Windows 叢集所在的匹配修補程式版本,使用 RKE2 v1.22 佈建一個新的 RKE2 Windows 下游叢集。
- 開始將 Windows 工作負載從 RKE1 遷移到 RKE2 叢集。
- 執行驗證測試以確保在將應用程式從 RKE1 遷移到 RKE2 時沒有功能損失或變更。
- 成功進行驗證測試後 ,您可以選擇將 RKE2 1.22.x 叢集升級到新的次要版本,例如 1.23 或 1.24。
當 RKE2 使用較新的 Kubernetes 修補程式版本時:
- 使用 RKE2 v1.23 或 v1.24 佈建一個新的 RKE2 Windows 下游叢集。
- 開始將 Windows 工作負載從 RKE1 遷移到 RKE2 叢集。
- 執行驗證測試以確保在將應用程式從 RKE1 遷移到 RKE2 時沒有功能損失或變更。