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>
$ ccoctl gcp delete \ --name=<name> \1 --project=<gcp_project_id> \2 --credentials-requests-dir=<path_to_credentials_requests_directory>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
検証
- リソースが削除されたことを確認するには、GCP にクエリーを実行します。詳細は、GCP ドキュメントをご覧ください。