7.9.2.2. Cloud Credential Operator ユーティリティーを使用した Google Cloud リソースの作成
ccoctl gcp create-all コマンドを使用して、Google Cloud リソースの作成を自動化できます。
デフォルトで、ccoctl はコマンドが実行されるディレクトリーにオブジェクトを作成します。オブジェクトを別のディレクトリーに作成するには、--output-dir フラグを使用します。この手順では、<path_to_ccoctl_output_dir> を使用してこの場所を参照します。
前提条件
以下が必要になります。
-
ccoctlバイナリーを展開して準備した。
手順
次のコマンドを実行して、インストールファイルのリリースイメージを
$RELEASE_IMAGE変数に設定します。$ RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}')以下のコマンドを実行して、OpenShift Container Platform リリースイメージから
CredentialsRequestオブジェクトのリストを抽出します。$ oc adm release extract \ --from=$RELEASE_IMAGE \ --credentials-requests \ --included \1 --install-config=<path_to_directory_with_installation_configuration>/install-config.yaml \2 --to=<path_to_directory_for_credentials_requests>3 次のコマンドを実行し、
ccoctlツールを使用してCredentialsRequestオブジェクトをすべて処理します。$ ccoctl gcp create-all \ --name=<name> \1 --region=<gcp_region> \2 --project=<gcp_project_id> \3 --credentials-requests-dir=<path_to_credentials_requests_directory>4 - 1
- トラッキングに使用される、作成されたすべての Google Cloud リソースのユーザー定義名を指定します。Google Cloud Filestore Container Storage Interface (CSI) Driver Operator をインストールする予定の場合は、この値を保管しておきます。
- 2
- クラウドリソースを作成する Google Cloud リージョンを指定します。
- 3
- クラウドリソースを作成する Google Cloud プロジェクト ID を指定します。
- 4
- Google Cloud サービスアカウントを作成するために、
CredentialsRequestマニフェストのファイルを含むディレクトリーを指定します。注記クラスターで
TechPreviewNoUpgrade機能セットによって有効化されたテクノロジープレビュー機能を使用している場合は、--enable-tech-previewパラメーターを含める必要があります。
検証
OpenShift Container Platform シークレットが作成されることを確認するには、
<path_to_ccoctl_output_dir>/manifestsディレクトリーのファイルを一覧表示します。$ ls <path_to_ccoctl_output_dir>/manifests出力例
cluster-authentication-02-config.yaml openshift-cloud-controller-manager-gcp-ccm-cloud-credentials-credentials.yaml openshift-cloud-credential-operator-cloud-credential-operator-gcp-ro-creds-credentials.yaml openshift-cloud-network-config-controller-cloud-credentials-credentials.yaml openshift-cluster-api-capg-manager-bootstrap-credentials-credentials.yaml openshift-cluster-csi-drivers-gcp-pd-cloud-credentials-credentials.yaml openshift-image-registry-installer-cloud-credentials-credentials.yaml openshift-ingress-operator-cloud-credentials-credentials.yaml openshift-machine-api-gcp-cloud-credentials-credentials.yamlGoogle Cloud にクエリーを実行すると、IAM サービスアカウントが作成されていることを確認できます。詳細は、IAM サービスアカウントのリスト表示に関する Google Cloud のドキュメントを参照してください。