$ ./openshift-install destroy cluster \
--dir <installation_directory> --log-level info (1) (2)
您可以移除部署到Google Cloud Platform (GCP) 的集群。
您可以从云中移除使用安装程序预配基础设施的集群。
您拥有用于部署集群的安装程序副本。
您拥有创建集群时安装程序生成的文 件。
在包含安装程序的用于安装集群的计算机上的目录中,运行以下命令:
$ ./openshift-install destroy cluster \
--dir <installation_directory> --log-level info (1) (2)
1 | 对于<installation_directory> ,请指定存储安装文件的目录的路径。 |
2 | 要查看不同的详细信息,请指定warn 、debug 或error 代替info 。 |
您必须指定包含集群定义文件的集群目录。安装程序需要此目录中的 |
可选:删除<installation_directory>
目录和OpenShift Container Platform安装程序。
卸载使用在集群外部管理的短期凭据的OpenShift Container Platform集群后,您可以使用CCO实用程序 (ccoctl
) 删除ccoctl
在安装期间创建的Google Cloud Platform (GCP) 资源。
解压并准备ccoctl
二进制文件。
卸载使用短期凭据的GCP上的OpenShift Container Platform集群。
通过运行以下命令,使用安装文件中的发行版镜像设置$RELEASE_IMAGE
变量:
$ RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}')
通过运行以下命令,从OpenShift Container Platform发行版镜像中提取CredentialsRequest
自定义资源 (CR) 列表:
$ oc adm release extract \
--from=$RELEASE_IMAGE \
--credentials-requests \
--included \(1)
--to=<path_to_directory_for_credentials_requests> (2)
1 | --included 参数仅包含特定集群配置所需的清单。 |
2 | 指定要存储CredentialsRequest 对象的目录的路径。如果指定的目录不存在,此命令将创建它。 |
通过运行以下命令删除ccoctl
创建的GCP资源:
$ ccoctl gcp delete \
--name=<name> \(1)
--project=<gcp_project_id> \(2)
--credentials-requests-dir=<path_to_credentials_requests_directory> \
--force-delete-custom-roles (3)
1 | <name> 与最初用于创建和标记云资源的名称匹配。 |
2 | <gcp_project_id> 是要删除云资源的GCP项目ID。 |
3 | 可选:此参数删除ccoctl 实用程序在安装过程中创建的自定义角色。GCP不会立即永久删除自定义角色。更多信息,请参阅有关删除自定义角色的GCP文档。 |
要验证资源是否已删除,请查询GCP。更多信息,请参阅GCP文档。