Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

第 9 章 卸载 OpenShift Container Platform

您可以通过运行 uninstall.yml playbook 来卸载集群中的 OpenShift Container Platform 主机。此 playbook 删除 Ansible 安装的 OpenShift Container Platform 内容,包括:

  • Configuration
  • 容器
  • 默认模板和镜像流
  • 镜像
  • RPM 软件包

playbook 删除您在运行 playbook 时指定的清单文件中定义的任何主机的内容。

重要

在卸载集群前,请查看以下情况列表,并确定卸载是最佳选项:

  • 如果安装过程失败,且想继续这个过程,您可以重试安装。安装 playbook 旨在如果无法安装集群,可以在不需要卸载集群的情况下再次运行它们。
  • 如果要从开始重启失败的安装,可以通过运行 uninstall.yml playbook 来卸载集群中的 OpenShift Container Platform 主机,如以下部分所述。此 playbook 仅为您安装的最新版本卸载 OpenShift Container Platform 资产。
  • 如果必须更改主机名或证书名称,必须在重试安装前重新创建证书,方法是运行 uninstall.yml playbook。再次运行安装 playbook 不会重新创建证书。
  • 如果要重新使用之前安装的 OpenShift Container Platform 的主机,如使用概念验证安装,或想要安装不同的 OpenShift Container Platform 次要或异步版本,您必须在生产集群中使用主机前重新制作这些主机的镜像。运行 uninstall.yml playbook 后,一些主机资产可能会保持在更改的状态。

9.1. 卸载 OpenShift Container Platform 集群

要在集群中的所有主机中卸载 OpenShift Container Platform,进入 playbook 目录,并使用您最近使用的清单文件运行 playbook:

# ansible-playbook [-i /path/to/file] \ 1
    /usr/share/ansible/openshift-ansible/playbooks/adhoc/uninstall.yml
1
如果您的清单文件不在 /etc/ansible/hosts 目录中,使用 -i 指定清单文件的路径。