14.2. Cloud Credential Operator 유틸리티를 사용하여 GCP 리소스 삭제
GCP Workload Identity를 사용하여 수동 모드에서 CCO(Cloud Credential Operator)를 사용하여 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 설명서를 참조하십시오.