15.2. 使用 Cloud Credential Operator 实用程序删除 Google Cloud 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}')- $ RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}')- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- 运行以下命令,从 OpenShift Container Platform 发行镜像中提取 - CredentialsRequest自定义资源 (CR) 列表:- oc adm release extract \ --from=$RELEASE_IMAGE \ --credentials-requests \ --included \ --to=<path_to_directory_for_credentials_requests> - $ oc adm release extract \ --from=$RELEASE_IMAGE \ --credentials-requests \ --included \- 1 - --to=<path_to_directory_for_credentials_requests>- 2 - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- 运行以下命令,删除 - ccoctl创建的 GCP 资源:- ccoctl gcp delete \ --name=<name> \ --project=<gcp_project_id> \ --credentials-requests-dir=<path_to_credentials_requests_directory> \ --force-delete-custom-roles - $ ccoctl gcp delete \ --name=<name> \- 1 - --project=<gcp_project_id> \- 2 - --credentials-requests-dir=<path_to_credentials_requests_directory> \ --force-delete-custom-roles- 3 - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
验证
- 要验证资源是否已被删除,请查询 GCP。如需更多信息,请参阅 GCP 文档。