9.4. Google Cloud プロジェクトの設定
OpenShift Container Platform をインストールする前に、これをホストするように Google Cloud プロジェクトを設定する必要があります。
9.4.1. Google Cloud プロジェクトの作成 リンクのコピーリンクがクリップボードにコピーされました!
OpenShift Container Platform をインストールするには、クラスターをホストするために Google Cloud アカウントでプロジェクトを作成する必要があります。
手順
OpenShift Container Platform クラスターをホストするプロジェクトを作成します。Google Cloud ドキュメントの プロジェクトの作成と管理 を参照してください。
重要Google Cloud プロジェクトは、installer-provisioned infrastructure を使用している場合には、Premium Network Service 階層を使用する必要があります。インストールプログラムを使用してインストールしたクラスターでは、Standard Network Service 階層はサポートされません。インストールプログラムは、
api-int.<cluster_name>.<base_domain>の内部負荷分散を設定します。内部負荷分散には Premium Tier が必要です。
9.4.2. Google Cloud で API サービスを有効にする リンクのコピーリンクがクリップボードにコピーされました!
Google Cloud プロジェクトでは、OpenShift Container Platform インストールを完了するために複数の API サービスへのアクセスが必要です。
前提条件
- クラスターをホストするためのプロジェクトを作成した。
手順
クラスターをホストするプロジェクトで以下の必要な API サービスを有効にします。インストールに不要なオプションの API サービスを有効にすることもできます。Google Cloud ドキュメントの サービスの有効化 を参照してください。
Expand 表9.1 必要な API サービス API サービス コンソールサービス名 Compute Engine API
compute.googleapis.comCloud Resource Manager API
cloudresourcemanager.googleapis.comCloud 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 表9.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
9.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 ドキュメントの Look up your Cloud DNS name servers を参照してください。
通常は、4 つのネームサーバーがあります。
- ドメインが使用するネームサーバーのレジストラーレコードを更新します。たとえば、ドメインを Google ドメインに登録している場合は、Google Domains Help で How to switch to custom name servers のトピックを参照してください。
- ルートドメインを Google Cloud DNS に移行している場合は、DNS レコードを移行します。Google Cloud ドキュメントの Migrating to Cloud DNS を参照してください。
- サブドメインを使用する場合は、所属する会社の手順に従ってその委任レコードを親ドメインに追加します。このプロセスには、所属企業の IT 部門や、会社のルートドメインと DNS サービスを制御する部門へのリクエストが含まれる場合があります。
9.4.4. Google Cloud アカウントの制限 リンクのコピーリンクがクリップボードにコピーされました!
OpenShift Container Platform クラスターは多くの Google Cloud コンポーネントを使用しますが、デフォルトの クォータ はデフォルトの OpenShift Container Platform クラスターをインストールする機能に影響を与えません。
3 つのコンピュートマシンおよび 3 つのコントロールプレーンマシンが含まれるデフォルトクラスターは以下のリソースを使用します。一部のリソースはブートストラッププロセス時にのみ必要となり、クラスターのデプロイ後に削除されることに注意してください。
| Service | コンポーネント | 場所 | 必要なリソースの合計 | ブートストラップ後に削除されるリソース |
|---|---|---|---|---|
| サービスアカウント | 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 クラスターをインストールする前にサポートチケットを解決できるように、クラスターのサイズを早期に計画してください。
9.4.5. Google Cloud でサービスアカウントを作成する リンクのコピーリンクがクリップボードにコピーされました!
OpenShift Container Platform には、Google API でデータにアクセスするための認証および承認を提供する Google Cloud サービスアカウントが必要です。プロジェクトに必要なロールが含まれる既存の IAM サービスアカウントがない場合は、これを作成する必要があります。
前提条件
- クラスターをホストするためのプロジェクトを作成した。
手順
- OpenShift Container Platform クラスターをホストするために使用するプロジェクトでサービスアカウントを作成します。Google Cloud ドキュメントの Creating a service account を参照してください。
サービスアカウントに適切な権限を付与します。以下の個別の権限を付与するか、
Ownerロールを割り当てることができます。特定のリソースのサービスアカウントへのロールの付与 を参照してください。注記サービスアカウントをプロジェクトの所有者にすることは、必要な権限を得る最も簡単な方法ですが、その場合、サービスアカウントはプロジェクトに対して完全な管理権限を持つことになります。この権限を提供することに伴うリスクが受け入れ可能であるかどうかを判別する必要があります。
サービスアカウントキーを JSON 形式で作成するか、サービスアカウントを Google Cloud 仮想マシンにアタッチできます。Google Cloud ドキュメントの Creating service account keys および Creating and enabling service accounts for instances を参照してください。
注記サービスアカウントがアタッチされた仮想マシンを使用してクラスターを作成する場合は、インストール前に
install-config.yamlファイルでcredentialsMode: Manualを設定する必要があります。
9.4.6. 必要な Google Cloud ロール リンクのコピーリンクがクリップボードにコピーされました!
作成したサービスアカウントに Owner ロールを割り当てると、OpenShift Container Platform のインストールに必要な権限を含め、すべての権限がそのサービスアカウントに付与されます。組織のセキュリティーポリシーによって、権限のセットをさらに制限することが求められる場合は、次の権限を持つサービスアカウントを作成できます。クラスターを既存の Virtual Private Cloud (VPC) にデプロイする場合、次のリストに記載されているネットワーク権限は、サービスアカウントに必要ありません。
インストールプログラムに必要なロール
- Compute Admin
- Role Administrator
- Security Admin
- Service Account Admin
- Service Account Key Admin
- Service Account User
- Storage Admin
インストール時のネットワークリソースの作成に必要なロール
- DNS Administrator
Passthrough モードで Cloud Credential Operator を使用するために必要なロール
- Compute Load Balancer Admin
- Tag User
ユーザーがプロビジョニングする Google Cloud インフラストラクチャーに必要なロール
- Deployment Manager Editor
次のロールは、コントロールプレーンとコンピュートマシンが使用するサービスアカウントに適用されます。
| アカウント | ロール |
|---|---|
| コントロールプレーン |
|
|
| |
|
| |
|
| |
|
| |
| Compute |
|
|
| |
|
|
9.4.7. user-provisioned infrastructure に必要な Google Cloud 権限 リンクのコピーリンクがクリップボードにコピーされました!
作成したサービスアカウントに Owner ロールを割り当てると、OpenShift Container Platform のインストールに必要な権限を含め、すべての権限がそのサービスアカウントに付与されます。
組織のセキュリティーポリシーで、より制限的なアクセス許可のセットが必要な場合は、必要なアクセス許可を持つ カスタムロール を作成できます。OpenShift Container Platform クラスターを作成および削除するには、user-provisioned infrastructure に以下のパーミッションが必要です。
例9.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.globalAddresses.create -
compute.globalAddresses.get -
compute.globalAddresses.use -
compute.globalForwardingRules.create -
compute.globalForwardingRules.get -
compute.globalForwardingRules.setLabels -
compute.networks.create -
compute.networks.get -
compute.networks.list -
compute.networks.updatePolicy -
compute.networks.use -
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
例9.2 ロードバランサーリソースの作成に必要な権限
-
compute.backendServices.create -
compute.backendServices.get -
compute.backendServices.list -
compute.backendServices.update -
compute.backendServices.use -
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 -
compute.targetTcpProxies.create -
compute.targetTcpProxies.get -
compute.targetTcpProxies.use
例9.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
例9.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
例9.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
例9.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
例9.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 -
compute.regionHealthChecks.create -
compute.regionHealthChecks.get -
compute.regionHealthChecks.useReadOnly
例9.8 Google Cloud ゾーンとリージョン関連の情報を取得するために必要な権限
-
compute.globalOperations.get -
compute.regionOperations.get -
compute.regions.get -
compute.regions.list -
compute.zoneOperations.get -
compute.zones.get -
compute.zones.list
例9.9 サービスとクォータを確認するために必要な権限
-
monitoring.timeSeries.list -
serviceusage.quotas.get -
serviceusage.services.list
例9.10 インストールに必要な IAM パーミッション
-
iam.roles.get
例9.11 サービスアカウントキーなしで認証する場合に必要な権限
-
iam.serviceAccounts.signBlob
例9.12 Key Management Service (KMS) キーリングを提供するときに必要なパーミッション
-
cloudkms.keyRings.list
例9.13 インストールに必要なイメージ権限
-
compute.images.create -
compute.images.delete -
compute.images.get -
compute.images.list
例9.14 収集ブートストラップを実行するためのオプションの権限
-
compute.instances.getSerialPortOutput
例9.15 ネットワークリソースを削除するために必要な権限
-
compute.addresses.delete -
compute.addresses.deleteInternal -
compute.addresses.list -
compute.addresses.setLabels -
compute.firewalls.delete -
compute.firewalls.list -
compute.forwardingRules.delete -
compute.forwardingRules.list -
compute.globalAddresses.delete -
compute.globalAddresses.list -
compute.globalForwardingRules.delete -
compute.globalForwardingRules.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
例9.16 ロードバランサーリソースを削除するために必要な権限
-
compute.backendServices.delete -
compute.backendServices.list -
compute.regionBackendServices.delete -
compute.regionBackendServices.list -
compute.targetPools.delete -
compute.targetPools.list -
compute.targetTcpProxies.delete -
compute.targetTcpProxies.list
例9.17 DNS リソースを削除するために必要な権限
-
dns.changes.create -
dns.managedZones.delete -
dns.managedZones.get -
dns.managedZones.list -
dns.resourceRecordSets.delete -
dns.resourceRecordSets.list
例9.18 サービスアカウントリソースを削除するために必要な権限
-
iam.serviceAccounts.delete -
iam.serviceAccounts.get -
iam.serviceAccounts.list -
resourcemanager.projects.getIamPolicy -
resourcemanager.projects.setIamPolicy
例9.19 コンピューティングリソースを削除するために必要な権限
-
compute.disks.delete -
compute.disks.list -
compute.instanceGroups.delete -
compute.instanceGroups.list -
compute.instances.delete -
compute.instances.list -
compute.instances.stop -
compute.machineTypes.list
例9.20 ストレージリソースの削除に必要
-
storage.buckets.delete -
storage.buckets.getIamPolicy -
storage.buckets.list -
storage.objects.delete -
storage.objects.list
例9.21 ヘルスチェックリソースを削除するために必要な権限
-
compute.healthChecks.delete -
compute.healthChecks.list -
compute.httpHealthChecks.delete -
compute.httpHealthChecks.list -
compute.regionHealthChecks.delete -
compute.regionHealthChecks.list
例9.22 削除に必要なイメージ権限
-
compute.images.delete -
compute.images.list
例9.23 リージョン関連の情報を取得するために必要な権限
-
compute.regions.get
例9.24 必要な Deployment Manager 権限
-
deploymentmanager.deployments.create -
deploymentmanager.deployments.delete -
deploymentmanager.deployments.get -
deploymentmanager.deployments.list -
deploymentmanager.manifests.get -
deploymentmanager.operations.get -
deploymentmanager.resources.list
9.4.8. サポート対象の Google Cloud リージョン リンクのコピーリンクがクリップボードにコピーされました!
OpenShift Container Platform クラスターを次の Google Cloud リージョンにデプロイできます。
-
africa-south1(Johannesburg, South Africa) -
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(Doha, Qatar, Middle East) -
me-central2(Dammam, Saudi Arabia, Middle East) -
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 の ドキュメント を参照してください。
9.4.9. Google Cloud の CLI ツールのインストールと設定 リンクのコピーリンクがクリップボードにコピーされました!
user-provisioned infrastructure を使用して Google Cloud に OpenShift Container Platform をインストールするには、Google Cloud の CLI ツールをインストールし、設定する必要があります。
前提条件
- クラスターをホストするためのプロジェクトを作成した。
- サービスアカウントを作成し、これに必要なパーミッションを付与しています。
手順
$PATHで以下のバイナリーをインストールします。-
gcloud -
gsutil
Google Cloud ドキュメントの Install the latest Cloud SDK version を参照してください。
-
設定したサービスアカウントで、
gcloudツールを使用して認証します。Google Cloud ドキュメントの Authorizing with a service account を参照してください。