10.4. Google Cloud プロジェクトの設定
OpenShift Container Platform をインストールする前に、これをホストするように Google Cloud プロジェクトを設定する必要があります。
10.4.1. Google Cloud プロジェクトの作成 リンクのコピーリンクがクリップボードにコピーされました!
OpenShift Container Platform をインストールするには、クラスターをホストするために Google Cloud アカウントでプロジェクトを作成する必要があります。
手順
OpenShift Container Platform クラスターをホストするプロジェクトを作成します。Google Cloud ドキュメントの Creating and Managing Projects を参照してください。
重要インストーラーでプロビジョニングされるインフラストラクチャーを使用している場合は、Google Cloud プロジェクトは Premium Network Service 階層を使用する必要があります。インストールプログラムを使用してインストールしたクラスターでは、Standard Network Service 階層はサポートされません。インストールプログラムは、
api-int.<cluster_name>.<base_domain>の内部負荷分散を設定します。内部負荷分散には Premium Tier が必要です。
10.4.2. Google Cloud での API サービスの有効化 リンクのコピーリンクがクリップボードにコピーされました!
Google Cloud プロジェクトでは、OpenShift Container Platform インストールを完了するために複数の API サービスへのアクセスが必要です。
前提条件
- クラスターをホストするためのプロジェクトを作成した。
手順
クラスターをホストするプロジェクトで以下の必要な API サービスを有効にします。インストールに不要なオプションの API サービスを有効にすることもできます。Google Cloud ドキュメント の サービスの有効化 を 参照してください。
Expand 表10.1 必要な API サービス API サービス コンソールサービス名 Compute Engine API
compute.googleapis.comCloud Resource Manager API
cloudresourcemanager.googleapis.comGoogle DNS API
dns.googleapis.comIAM Service Account Credentials API
iamcredentials.googleapis.comIdentity and Access Management (IAM) API
iam.googleapis.comService Usage API
serviceusage.googleapis.comExpand 表10.2 オプションの API サービス API サービス コンソールサービス名 Cloud Deployment Manager V2 API
deploymentmanager.googleapis.comGoogle Cloud API
cloudapis.googleapis.comService Management API
servicemanagement.googleapis.comGoogle Cloud Storage JSON API
storage-api.googleapis.comCloud Storage
storage-component.googleapis.com
10.4.3. Google Cloud の DNS の設定 リンクのコピーリンクがクリップボードにコピーされました!
OpenShift Container Platform をインストールするには、使用する Google Cloud アカウントに、OpenShift Container Platform クラスターをホストする同じプロジェクトに専用のパブリックホストゾーンがなければなりません。このゾーンはドメインに対する権威を持っている必要があります。DNS サービスは、クラスターへの外部接続のためのクラスターの DNS 解決および名前検索を提供します。
手順
ドメイン、またはサブドメイン、およびレジストラーを特定します。既存のドメインおよびレジストラーを移行するか、Google Cloud または他のソースから新規のものを取得できます。
注記新規ドメインを購入する場合、関連する DNS の変更が伝播するのに時間がかかる場合があります。Google 経由でドメインを購入する方法の詳細は、Google ドメイン を参照してください。
Google Cloud プロジェクトにドメインまたはサブドメインのパブリックホストゾーンを作成します。Google Cloud ドキュメントの Creating public zones を参照してください。
openshiftcorp.comなどのルートドメインや、clusters.openshiftcorp.comなどのサブドメインを使用します。ホストゾーンレコードから新規の権威ネームサーバーを抽出します。Google Cloud ドキュメント の Cloud DNS ネームサーバーの検索 を参照してください。
通常は、4 つのネームサーバーがあります。
- ドメインが使用するネームサーバーのレジストラーレコードを更新します。たとえば、ドメインを Google ドメインに登録している場合は、Google Domains Help で How to switch to custom name servers のトピックを参照してください。
- ルートドメインを Google Cloud DNS に移行している場合は、DNS レコードを移行します。Google Cloud のドキュメントの Migrating to Cloud DNS を参照してください。
- サブドメインを使用する場合は、所属する会社の手順に従ってその委任レコードを親ドメインに追加します。このプロセスには、所属企業の IT 部門や、会社のルートドメインと DNS サービスを制御する部門へのリクエストが含まれる場合があります。
10.4.4. Google Cloud アカウントの制限 リンクのコピーリンクがクリップボードにコピーされました!
OpenShift Container Platform クラスターは多くの Google Cloud コンポーネントを使用しますが、デフォルトの Quotas はデフォルトの OpenShift Container Platform クラスターをインストールする機能には影響しません。
3 つのコンピュートマシンおよび 3 つのコントロールプレーンマシンが含まれるデフォルトクラスターは以下のリソースを使用します。一部のリソースはブートストラッププロセス時にのみ必要となり、クラスターのデプロイ後に削除されることに注意してください。
| サービス | コンポーネント | 場所 | 必要なリソースの合計 | ブートストラップ後に削除されるリソース |
|---|---|---|---|---|
| サービスアカウント | IAM | グローバル | 6 | 1 |
| ファイアウォールのルール | ネットワーク | グローバル | 11 | 1 |
| 転送ルール | Compute | グローバル | 2 | 0 |
| ヘルスチェック | Compute | グローバル | 2 | 0 |
| イメージ | Compute | グローバル | 1 | 0 |
| ネットワーク | ネットワーク | グローバル | 1 | 0 |
| ルーター | ネットワーク | グローバル | 1 | 0 |
| ルート | ネットワーク | グローバル | 2 | 0 |
| サブネットワーク | Compute | グローバル | 2 | 0 |
| ターゲットプール | ネットワーク | グローバル | 2 | 0 |
インストール時にクォータが十分ではない場合、インストールプログラムは超過したクォータとリージョンの両方を示すエラーを表示します。
実際のクラスターサイズ、計画されるクラスターの拡張、およびアカウントに関連付けられた他のクラスターからの使用法を考慮してください。CPU、静的 IP アドレス、および永続ディスク SSD(ストレージ) のクォータは、ほとんどの場合に不十分になる可能性のあるものです。
以下のリージョンのいずれかにクラスターをデプロイする予定の場合、ストレージクォータの最大値を超え、CPU クォータ制限を超える可能性が高くなります。
-
asia-east2 -
asia-northeast2 -
asia-south1 -
australia-southeast1 -
europe-north1 -
europe-west2 -
europe-west3 -
europe-west6 -
northamerica-northeast1 -
southamerica-east1 -
us-west2
Google Cloud コンソール からリソースクォータを増やすことはできますが、サポートチケットを作成する必要がある場合があります。OpenShift Container Platform クラスターをインストールする前にサポートチケットを解決できるように、クラスターのサイズを早期に計画してください。
10.4.5. Google Cloud でのサービスアカウントの作成 リンクのコピーリンクがクリップボードにコピーされました!
OpenShift Container Platform には、Google API のデータにアクセスするために認証および承認を提供する Google Cloud サービスアカウントが必要です。プロジェクトに必要なロールが含まれる既存の IAM サービスアカウントがない場合は、これを作成する必要があります。
前提条件
- クラスターをホストするためのプロジェクトを作成した。
手順
- OpenShift Container Platform クラスターをホストするために使用するプロジェクトでサービスアカウントを作成します。Google Cloud ドキュメント の サービスアカウントの作成 を参照してください。
サービスアカウントに適切な権限を付与します。以下の個別の権限を付与するか、
Ownerロールを割り当てることができます。特定のリソースのサービスアカウントへのロールの付与 を参照してください。注記サービスアカウントをプロジェクトの所有者にすることは、必要な権限を得る最も簡単な方法ですが、その場合、サービスアカウントはプロジェクトに対して完全な管理権限を持つことになります。この権限を提供することに伴うリスクが受け入れ可能であるかどうかを判別する必要があります。
サービスアカウントキーを JSON 形式で作成するか、サービスアカウントを Google Cloud 仮想マシンにアタッチできます。Google Cloud のドキュメント の サービスアカウントキー の作成 および インスタンスのサービスアカウントの作成および有効化 を参照してください。
クラスターを作成するには、サービスアカウントキーまたはサービスアカウントがアタッチされた仮想マシンが必要です。
注記サービスアカウントがアタッチされた仮想マシンを使用してクラスターを作成する場合は、インストール前に
install-config.yamlファイルでcredentialsMode: Manualを設定する必要があります。
10.4.6. 必須 Google Cloud ロール リンクのコピーリンクがクリップボードにコピーされました!
作成したサービスアカウントに Owner ロールを割り当てると、OpenShift Container Platform のインストールに必要な権限を含め、すべての権限がそのサービスアカウントに付与されます。組織のセキュリティーポリシーでより制限的なアクセス許可セットが必要な場合は、次のアクセス許可を持つサービスアカウントを作成できます。
Cloud Credential Operator を passthrough モードで動作するように設定する場合、粒度の細かいパーミッションではなくロールを使用する必要があります。
クラスターを既存の Virtual Private Cloud (VPC) にデプロイする場合、次のリストに記載されているネットワーク権限は、サービスアカウントに必要ありません。
インストールプログラムに必要なロール
- Compute 管理者
- IAM セキュリティー管理者
- サービスアカウント管理者
- Service Account Key Admin
- Service Account User
- Storage Admin
インストール時のネットワークリソースの作成に必要なロール
- DNS 管理者
パススルー認証情報モードの使用に必要なロール
- ロードバランサー計算の管理者
- IAM ロールビューアー
ユーザーによってプロビジョニングされる Google Cloud インフラストラクチャーに必要なロール
- Deployment Manager Editor
ロールは、コントロールプレーンおよびコンピュートマシンが使用するサービスアカウントに適用されます。
| アカウント | ロール |
|---|---|
| コントロールプレーン |
|
|
| |
|
| |
|
| |
|
| |
| Compute |
|
|
|
10.4.7. ユーザーによってプロビジョニングされるインフラストラクチャーに必要な Google Cloud 権限 リンクのコピーリンクがクリップボードにコピーされました!
作成したサービスアカウントに Owner ロールを割り当てると、OpenShift Container Platform のインストールに必要な権限を含め、すべての権限がそのサービスアカウントに付与されます。
組織のセキュリティーポリシーでより制限的なアクセス許可セットが必要な場合は、必要なアクセス許可を持つ カスタムロール を作成できます。OpenShift Container Platform クラスターを作成および削除するには、user-provisioned infrastructure に以下のパーミッションが必要です。
Cloud Credential Operator を passthrough モードで動作するように設定する場合、粒度の細かいパーミッションではなくロールを使用する必要があります。詳細は、「必須の GCP ロール」セクションの「パススルー認証情報モードを使用するための必要なロール」を参照してください。
例10.1 ネットワークリソースの作成に必要な権限
-
compute.addresses.create -
compute.addresses.createInternal -
compute.addresses.delete -
compute.addresses.get -
compute.addresses.list -
compute.addresses.use -
compute.addresses.useInternal -
compute.firewalls.create -
compute.firewalls.delete -
compute.firewalls.get -
compute.firewalls.list -
compute.forwardingRules.create -
compute.forwardingRules.get -
compute.forwardingRules.list -
compute.forwardingRules.setLabels -
compute.networks.create -
compute.networks.get -
compute.networks.list -
compute.networks.updatePolicy -
compute.routers.create -
compute.routers.get -
compute.routers.list -
compute.routers.update -
compute.routes.list -
compute.subnetworks.create -
compute.subnetworks.get -
compute.subnetworks.list -
compute.subnetworks.use -
compute.subnetworks.useExternalIp
例10.2 ロードバランサーリソースの作成に必要な権限
-
compute.regionBackendServices.create -
compute.regionBackendServices.get -
compute.regionBackendServices.list -
compute.regionBackendServices.update -
compute.regionBackendServices.use -
compute.targetPools.addInstance -
compute.targetPools.create -
compute.targetPools.get -
compute.targetPools.list -
compute.targetPools.removeInstance -
compute.targetPools.use
例10.3 DNS リソースの作成に必要な権限
-
dns.changes.create -
dns.changes.get -
dns.managedZones.create -
dns.managedZones.get -
dns.managedZones.list -
dns.networks.bindPrivateDNSZone -
dns.resourceRecordSets.create -
dns.resourceRecordSets.list -
dns.resourceRecordSets.update
例10.4 サービスアカウントリソースの作成に必要な権限
-
iam.serviceAccountKeys.create -
iam.serviceAccountKeys.delete -
iam.serviceAccountKeys.get -
iam.serviceAccountKeys.list -
iam.serviceAccounts.actAs -
iam.serviceAccounts.create -
iam.serviceAccounts.delete -
iam.serviceAccounts.get -
iam.serviceAccounts.list -
resourcemanager.projects.get -
resourcemanager.projects.getIamPolicy -
resourcemanager.projects.setIamPolicy
例10.5 コンピューティングリソースの作成に必要な権限
-
compute.disks.create -
compute.disks.get -
compute.disks.list -
compute.instanceGroups.create -
compute.instanceGroups.delete -
compute.instanceGroups.get -
compute.instanceGroups.list -
compute.instanceGroups.update -
compute.instanceGroups.use -
compute.instances.create -
compute.instances.delete -
compute.instances.get -
compute.instances.list -
compute.instances.setLabels -
compute.instances.setMetadata -
compute.instances.setServiceAccount -
compute.instances.setTags -
compute.instances.use -
compute.machineTypes.get -
compute.machineTypes.list
例10.6 ストレージリソースの作成に必要
-
storage.buckets.create -
storage.buckets.delete -
storage.buckets.get -
storage.buckets.list -
storage.objects.create -
storage.objects.delete -
storage.objects.get -
storage.objects.list
例10.7 ヘルスチェックリソースを作成するために必要な権限
-
compute.healthChecks.create -
compute.healthChecks.get -
compute.healthChecks.list -
compute.healthChecks.useReadOnly -
compute.httpHealthChecks.create -
compute.httpHealthChecks.get -
compute.httpHealthChecks.list -
compute.httpHealthChecks.useReadOnly
例10.8 Google Cloud ゾーンとリージョン関連情報を取得するために必要な権限
-
compute.globalOperations.get -
compute.regionOperations.get -
compute.regions.list -
compute.zoneOperations.get -
compute.zones.get -
compute.zones.list
例10.9 サービスとクォータを確認するために必要な権限
-
monitoring.timeSeries.list -
serviceusage.quotas.get -
serviceusage.services.list
例10.10 インストールに必要な IAM パーミッション
-
iam.roles.get
例10.11 インストールに必要なイメージ権限
-
compute.images.create -
compute.images.delete -
compute.images.get -
compute.images.list
例10.12 収集ブートストラップを実行するためのオプションの権限
-
compute.instances.getSerialPortOutput
例10.13 ネットワークリソースを削除するために必要な権限
-
compute.addresses.delete -
compute.addresses.deleteInternal -
compute.addresses.list -
compute.firewalls.delete -
compute.firewalls.list -
compute.forwardingRules.delete -
compute.forwardingRules.list -
compute.networks.delete -
compute.networks.list -
compute.networks.updatePolicy -
compute.routers.delete -
compute.routers.list -
compute.routes.list -
compute.subnetworks.delete -
compute.subnetworks.list
例10.14 ロードバランサーリソースを削除するために必要な権限
-
compute.regionBackendServices.delete -
compute.regionBackendServices.list -
compute.targetPools.delete -
compute.targetPools.list
例10.15 DNS リソースを削除するために必要な権限
-
dns.changes.create -
dns.managedZones.delete -
dns.managedZones.get -
dns.managedZones.list -
dns.resourceRecordSets.delete -
dns.resourceRecordSets.list
例10.16 サービスアカウントリソースを削除するために必要な権限
-
iam.serviceAccounts.delete -
iam.serviceAccounts.get -
iam.serviceAccounts.list -
resourcemanager.projects.getIamPolicy -
resourcemanager.projects.setIamPolicy
例10.17 コンピューティングリソースを削除するために必要な権限
-
compute.disks.delete -
compute.disks.list -
compute.instanceGroups.delete -
compute.instanceGroups.list -
compute.instances.delete -
compute.instances.list -
compute.instances.stop -
compute.machineTypes.list
例10.18 ストレージリソースの削除に必要
-
storage.buckets.delete -
storage.buckets.getIamPolicy -
storage.buckets.list -
storage.objects.delete -
storage.objects.list
例10.19 ヘルスチェックリソースを削除するために必要な権限
-
compute.healthChecks.delete -
compute.healthChecks.list -
compute.httpHealthChecks.delete -
compute.httpHealthChecks.list
例10.20 削除に必要なイメージ権限
-
compute.images.delete -
compute.images.list
例10.21 リージョン関連の情報を取得するために必要な権限
-
compute.regions.get
例10.22 必要な Deployment Manager 権限
-
deploymentmanager.deployments.create -
deploymentmanager.deployments.delete -
deploymentmanager.deployments.get -
deploymentmanager.deployments.list -
deploymentmanager.manifests.get -
deploymentmanager.operations.get -
deploymentmanager.resources.list
10.4.8. サポートされている Google Cloud リージョン リンクのコピーリンクがクリップボードにコピーされました!
OpenShift Container Platform クラスターを以下の Google Cloud リージョンにデプロイできます。
-
asia-east1(Changhua County, Taiwan) -
asia-east2(Hong Kong) -
asia-northeast1(Tokyo, Japan) -
asia-northeast2(Osaka, Japan) -
asia-northeast3(Seoul, South Korea) -
asia-south1(Mumbai, India) -
asia-south2(Delhi, India) -
asia-southeast1(Jurong West, Singapore) -
asia-southeast2(Jakarta, Indonesia) -
australia-southeast1(Sydney, Australia) -
australia-southeast2(Melbourne, Australia) -
europe-central2(Warsaw, Poland) -
europe-north1(Hamina, Finland) -
europe-southwest1(Madrid, Spain) -
europe-west1(St. Ghislain, Belgium) -
europe-west2(London, England, UK) -
europe-west3(Frankfurt, Germany) -
europe-west4(Eemshaven, Netherlands) -
europe-west6(Zürich, Switzerland) -
europe-west8(Milan, Italy) -
europe-west9(Paris, France) -
europe-west12(Turin, Italy) -
me-central1(ドーハ、カタール、中東) -
me-west1(Tel Aviv, Israel) -
northamerica-northeast1(Montréal, Québec, Canada) -
northamerica-northeast2(Toronto, Ontario, Canada) -
southamerica-east1(São Paulo, Brazil) -
southamerica-west1(Santiago, Chile) -
us-central1(Council Bluffs, Iowa, USA) -
us-east1(Moncks Corner, South Carolina, USA) -
us-east4(Ashburn, Northern Virginia, USA) -
us-east5(Columbus, Ohio) -
us-south1(Dallas, Texas) -
us-west1(The Dalles, Oregon, USA) -
us-west2(Los Angeles, California, USA) -
us-west3(Salt Lake City, Utah, USA) -
us-west4(Las Vegas, Nevada, USA)
リージョンおよびゾーンごとにどのマシンタイプのインスタンスが使用できるかを確認するには、Google の ドキュメント を参照してください。
10.4.9. Google Cloud の CLI ツールのインストールと設定 リンクのコピーリンクがクリップボードにコピーされました!
ユーザーによってプロビジョニングされるインフラストラクチャーを使用して Google Cloud に OpenShift Container Platform をインストールするには、Google Cloud の CLI ツールをインストールし、設定する必要があります。
前提条件
- クラスターをホストするためのプロジェクトを作成した。
- サービスアカウントを作成し、これに必要なパーミッションを付与しています。
手順
$PATHで以下のバイナリーをインストールします。-
gcloud -
gsutil
Google Cloud のドキュメントの Install the latest Cloud SDK version を参照してください。
-
設定したサービスアカウントで、
gcloudツールを使用して認証します。Google Cloud ドキュメント で、サービスアカウントでの認証 を参照してください。