95. 在 Rancher 配置的 RKE2 或 K3s 集群升级 Kubernetes 时,保留自定义插件配置

95. 在 Rancher 配置的 RKE2 或 K3s 集群升级 Kubernetes 时,保留自定义插件配置 Environment 环境Rancher v2.6 - v2.12 牧场主 v2.6 - v2.12A Rancher-provisioned RKE2 or K3s cluster with customizations to add-on configurations一个由 Rancher 配置的 RKE2 或 K3s 集群并可自定义附加配置Procedure 程序In Rancher-provisioned RKE2 and K3s clusters the cluster components, such as the CNI or Cloud Provider, are managed via add-ons. The version of an add-on, and the available configuration, in addition to as default values, are tied to the particular RKE2 or K3s Kubernetes version.在 Rancher 配置的 RKE2 和 K3s 集群中集群组件如 CNI 或云提供商通过插件管理。插件的版本及其可用配置除了默认值外都绑定于特定的 RKE2 或 K3s Kubernetes 版本。In the UI form for add-on configuration (e.g. Cluster Management - Edit Config - Add-on: Calico) a warning is displayed: Add-On Configuration can vary between Kubernetes versions. Changing the Kubernetes version may reset the values below. Upgrading the Kubernetes version (Cluster Management - Edit Config - Basics - Kubernetes Version) and clicking Save will display a warning: Changing the Kubernetes Version can reset Add-On values. You should check that the values are as expected before continuing. If a user clicks Continue and the upgrade is performed, without first re-applying any add-on configuration customizations, add-on configuration may revert to the default values, resulting in unexpected behaviour or cluster errors.在插件配置的界面表单中例如集群管理 - 编辑配置 - 插件Calico显示警告“插件配置在不同 Kubernetes 版本之间可能有所不同。更改 Kubernetes 版本可能会重置以下数值。”升级 Kubernetes 版本Cluster Management - 编辑配置 - 基础 - Kubernetes 版本并点击“保存”会显示警告“更改 Kubernetes 版本可以重置插件值。继续之前你应该检查数值是否符合预期。”如果用户点击“继续”并完成升级且未先重新应用任何附加配置自定义附加配置可能会恢复为默认值导致意外行为或集群错误。In order to mitigate this and ensure that any custom add-on configuration is persisted across the upgrade, the following procedure should be used:为了缓解这一问题并确保任何自定义附加配置在升级过程中得以保留应采用以下步骤Take a copy of the add-on custom configurations获取附加自定义配置的副本Change the Kubernetes Version更改 Kubernetes 版本Navigate back to the add-on configurations and re-apply any custom values that have been erased as a result of the change in Kubernetes Version返回插件配置重新应用因 Kubernetes 版本变更而被删除的自定义值Click on Save to apply the changes, and click Continue when the Add-On Reset warning is displayed点击保存以应用更改当显示“插件重置”警告时点击继续In Rancher v2.13 improvements have been made to the UI handling of custom add-on configuration values, as detailed in https://github.com/rancher/dashboard/issues/5837在 Rancher v2.13 中用户界面处理自定义附加配置值有所改进详见 https://github.com/rancher/dashboard/issues/5837访问Rancher-K8S解决方案博主企业合作伙伴 https://blog.csdn.net/lidw2009