14.2. 使用 Cloud Credential Operator 实用程序删除 GCP 资源
				要在通过带有 GCP Workload Identity 的手动模式使用 Cloud Credential Operator(CCO)卸载 OpenShift Container Platform 集群后清除资源,您可以使用 CCO 实用程序(ccoctl)删除 ccoctl 在安装过程中创建的 GCP 资源。
			
先决条件
- 
						提取并准备 ccoctl二进制文件。
- 通过带有 GCP Workload Identity 的手动模式使用 CCO 安装 OpenShift Container Platform 集群。
流程
- 运行以下命令来获取 OpenShift Container Platform 发行镜像: - 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 --credentials-requests \ --cloud=gcp \ --to=<path_to_directory_with_list_of_credentials_requests>/credrequests \ $RELEASE_IMAGE - $ oc adm release extract --credentials-requests \ --cloud=gcp \ --to=<path_to_directory_with_list_of_credentials_requests>/credrequests \- 1 - $RELEASE_IMAGE- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- credrequests是存储- CredentialsRequest对象列表的目录。如果该目录不存在,此命令就会创建该目录。
 
- 删除 - ccoctl创建的 GCP 资源:- ccoctl gcp delete \ --name=<name> \ --project=<gcp_project_id> \ --credentials-requests-dir=<path_to_directory_with_list_of_credentials_requests>/credrequests - $ ccoctl gcp delete \ --name=<name> \- 1 - --project=<gcp_project_id> \- 2 - --credentials-requests-dir=<path_to_directory_with_list_of_credentials_requests>/credrequests- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
验证
- 要验证资源是否已被删除,请查询 GCP。如需更多信息,请参阅 GCP 文档。