回滚
本页概述了如何在升级 Rancher 后将 Rancher 回滚到之前的版本。
|
请在以下情况时按照本页的说明进行操作:
-
正在运行的 Rancher 实例在备份完成后升级到了更新的版本。
-
上游(本地)集群与进行备份的集群相同。
|
To roll back Rancher to a lower/previous version, use the Rancher Backups application and restore Rancher from backup.
回滚后,Rancher 必须以较低/较早的版本启动。
还原是通过创建 Restore 自定义资源实现的。
重要提示:
|
步骤 1 :创建 Restore 自定义资源
-
点击 ☰ > 集群管理。
-
找到你的本地集群,并点击 Explore。
-
在左侧导航栏中,点击
。
如果 Rancher Backups 应用不可见,你需要到 Apps 的 Charts 页面中安装应用。详情请参见此处。 |
-
单击创建。
-
使用表单或 YAML 创建 Restore。如需获取使用表单创建 Restore 资源的更多信息,请参见配置参考和示例。
-
如需使用 YAML 编辑器,点击
。然后输入 Restore YAML。以下是 Restore 自定义资源示例:apiVersion: resources.cattle.io/v1 kind: Restore metadata: name: restore-migration spec: backupFilename: backup-b0450532-cee1-4aa1-a881-f5f48a007b1c-2020-09-15T07-27-09Z.tar.gz encryptionConfigSecretName: encryptionconfig storageLocation: s3: credentialSecretName: s3-creds credentialSecretNamespace: default bucketName: rancher-backups folder: rancher region: us-west-2 endpoint: s3.us-west-2.amazonaws.com
-
单击创建。
结果:已创建备份文件并更新到目标存储位置。资源还原顺序如下:
-
自定义资源定义(CRD)
-
集群范围资源
-
命名空间资源
如需查看还原的处理方式,请检查 Operator 的日志。按照如下步骤获取日志:
kubectl get pods -n cattle-resources-system
kubectl logs -n cattle-resources-system -f