You are viewing documentation for a release that is no longer maintained. To view the documentation for the most recent version, see the latest RHACS docs.
2.4. 回滚 Central
如果升级到新版本失败,您可以回滚到以前版本的 Central。
2.4.1. 正常回滚 Central 复制链接链接已复制到粘贴板!
如果升级 Red Hat Advanced Cluster Security for Kubernetes 失败,您可以回滚到以前版本的 Central。
先决条件
- 您必须使用 Red Hat Advanced Cluster Security for Kubernetes 3.0.57.0 或更高版本。
- 执行回滚前,持久性存储必须具有可用磁盘空间。Red Hat Advanced Cluster Security for Kubernetes 使用磁盘空间在升级过程中保留数据库副本。如果磁盘空间不足以存储副本,升级失败,您将无法回滚到较早的版本。
流程
当升级失败时( Central 服务启动前),运行以下命令回滚到以前的版本:
oc -n stackrox rollout undo deploy/central
$ oc -n stackrox rollout undo deploy/central
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 如果使用 Kubernetes,请输入
kubectl
而不是oc
。
2.4.2. 回滚 Central 强制 复制链接链接已复制到粘贴板!
您可以使用强制回滚来回滚到较早版本的 Central (在 Central 服务启动后)。
使用强制回滚来切换回以前的版本可能会导致数据丢失和功能。
先决条件
- 您必须使用 Red Hat Advanced Cluster Security for Kubernetes 3.0.58.0 或更高版本。
- 执行回滚前,持久性存储必须具有可用磁盘空间。Red Hat Advanced Cluster Security for Kubernetes 使用磁盘空间在升级过程中保留数据库副本。如果磁盘空间不足以存储副本,升级失败,您将无法回滚到较早的版本。
流程
运行以下命令来执行强制回滚:
强制回滚到之前安装的版本:
oc -n stackrox rollout undo deploy/central
$ oc -n stackrox rollout undo deploy/central
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 如果使用 Kubernetes,请输入
kubectl
而不是oc
。
强制回滚到特定版本:
编辑 Central 的
ConfigMap
:oc -n stackrox edit configmap/central-config
$ oc -n stackrox edit configmap/central-config
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 如果使用 Kubernetes,请输入
kubectl
而不是oc
。
更新
maintenance.forceRollbackVersion
键的值:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 指定要回滚到的版本。
更新 Central 镜像版本:
oc -n stackrox \ set image deploy/central central=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:<x.x.x.x>
$ oc -n stackrox \
1 set image deploy/central central=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:<x.x.x.x>
2 Copy to Clipboard Copied! Toggle word wrap Toggle overflow