60. 如何在 Rancher 中自定义和重置 rke-metadata-config 设置
是一个功能,使 Rancher 能够拉取 Rancher 次要版本的最新可用 Kubernetes 版本列表,而无需升级 Rancher 本身。在这种情况下,升级 Rancher 时,你应确保发布分支同时更新(例如使用下面文档中的 Helm values 方法)。在空隙环境下,Rancher 无法连接该 URL,你可能希望托管该仓库的内部镜像以使用该功能。每个小型 Rancher 版本都有独立的
Rancher v2.x 牧场主 v2.x
访问Rancher-K8S解决方案博主 :https://blog.csdn.net/lidw2009
Kontainer Driver Metadata (KDM) is a feature that enables Rancher to pull a list of the latest available Kubernetes versions for a Rancher minor release without requiring an upgrade of Rancher itself. By default, the metadata is pulled from a release-specific branch of the KDM GitHub repository, hosted at releases.rancher.com. In air-gapped environments, where Rancher is unable to connect to this URL, you may wish to host an internal mirror of this repository to use the feature.
Kontainer 驱动元数据(KDM) 是一个功能,使 Rancher 能够拉取 Rancher 次要版本的最新可用 Kubernetes 版本列表,而无需升级 Rancher 本身。默认情况下,元数据会从 KDM GitHub 仓库的某个特定版本分支拉取,该分支托管在 releases.rancher.com。在空隙环境下,Rancher 无法连接该 URL,你可能希望托管该仓库的内部镜像以使用该功能。
This article details how to customize KDM synchronization via Rancher's rke-metadata-config setting, as well as how to reset it to the default.
本文详细介绍了如何通过 Rancher 的 rke-metadata-config 设置自定义 KDM 同步,以及如何将其重置为默认状态。
Note: There is a separate KDM release branch for each minor release of Rancher, and the correct branch must be used for the running Rancher version. When running without a custom configuration, Rancher uses the default value in the rke-metadata-config setting, which includes the relevant branch for the current version. If you have set a value for the rke-metadata-config setting, the configuration will not be updated automatically. In that case, when upgrading Rancher, you should ensure that the release branch is updated in parallel (e.g. using the Helm values method documented below).
注: 每个小型 Rancher 版本都有独立的 KDM 发布分支,运行中的 Rancher 版本必须使用正确的分支。在没有自定义配置的情况下运行时,Rancher 使用 rke-metadata-config 设置中的默认值,该设置包含当前版本的相关分支。如果你为 rke-metadata-config 设置设置了值,配置不会自动更新。在这种情况下,升级 Rancher 时,你应确保发布分支同时更新(例如使用下面文档中的 Helm values 方法)。
Customizing the rke-metadata-config setting via the Rancher UI
通过 Rancher UI 自定义 rke-metadata-config 设置
To customize the rke-metadata-config setting via the Rancher UI, following the process outlined in the Rancher documentation.
通过 Rancher 界面自定义 rke-metadata-config 设置,按照 Rancher 文档中描述的流程进行。
Customizing the rke-metadata-config setting via Helm values
通过 Helm 值自定义 rke-metadata-config 设置
The rke-metadata-config can be configured via the Rancher environment variable CATTLE_RKE_METADATA_CONFIG.rke-metadata-config 可以通过 Rancher 环境变量 CATTLE_RKE_METADATA_CONFIG 配置。
In order to configure this environment variable on the Rancher Helm chart, follow the Rancher documentation for setting extra environment variables.
要在 Rancher Helm 图表上配置该环境变量,请按照 Rancher 文档设置额外环境变量 。
An example of the Helm values updating the rke-metadata-config URL to https://releases.example.com/kontainer-driver-metadata/release-v2.12/data.json is as follows:
Helm 值将 rke-metadata-config URL 更新为 https://releases.example.com/kontainer-driver-metadata/release-v2.12/data.json 的一个示例如下:
<span style="color:#000000"><span style="background-color:#ffffff"><span style="background-color:#f3f3f3">--set 'extraEnv[0].name=CATTLE_RKE_METADATA_CONFIG'
--set 'extraEnv[0].value=\{\"refresh-interval-minutes\":\"1450"\,\"url"\:\"<a data-cke-saved-href="https://releases.example.com/kontainer-driver-metadata/release-v2.12/data.json/" href="https://releases.example.com/kontainer-driver-metadata/release-v2.12/data.json/">https://releases.example.com/kontainer-driver-metadata/release-v2.12/data.json\</a>"}'</span></span></span>
Resetting the rke-metadata-config setting to the default
将 rke-metadata-config 设置重置为默认
As noted above, if you have set a value for the rke-metadata-config setting - even if that value matched the default at the time - the URL will no longer be updated automatically during Rancher upgrades.
如上所述,如果你为 rke-metadata-config 设置设置了某个值——即使该值当时与默认值一致——在 Rancher 升级过程中,URL 将不再自动更新。
If you would like to revert to the default rke-metadata-config behavior (pulling from releases.rancher.com with the URL automatically tracking your Rancher version), run the following command in the Rancher local cluster to remove the custom value:
如果你想恢复默认的 rke-metadata-config 行为(自动从带有 URL 的 releases.rancher.com 拉取,追踪你的 Rancher 版本),请在 Rancher 本地集群中执行以下命令以移除自定义值:
<span style="color:#000000"><span style="background-color:#ffffff"><span style="background-color:#efefef"><code>kubectl patch <a data-cke-saved-href="http://setting.management.cattle.io/" href="http://setting.management.cattle.io/">setting.management.cattle.io</a> rke-metadata-config --type='merge' -p '{"value":""}'</code></span></span></span>
更多推荐
所有评论(0)