検索

10.4. GCP プロジェクトの設定

download PDF

OpenShift Container Platform をインストールする前に、これをホストするように Google Cloud Platform (GCP) プロジェクトを設定する必要があります。

10.4.1. GCP プロジェクトの作成

OpenShift Container Platform をインストールするには、クラスターをホストするために Google Cloud Platform (GCP) アカウントでプロジェクトを作成する必要があります。

手順

  • OpenShift Container Platform クラスターをホストするプロジェクトを作成します。GCP ドキュメントの プロジェクトの作成と管理 を参照してください。

    重要

    GCP プロジェクトは、installer-provisioned infrastructure を使用している場合には、Premium Network Service 階層を使用する必要があります。インストールプログラムを使用してインストールしたクラスターでは、Standard Network Service 階層はサポートされません。インストールプログラムは、api-int.<cluster_name>.<base_domain> の内部負荷分散を設定します。内部負荷分散には Premium Tier が必要です。

10.4.2. GCP での API サービスの有効化

Google Cloud Platform (GCP) プロジェクトでは、OpenShift Container Platform インストールを完了するために複数の API サービスへのアクセスが必要です。

前提条件

  • クラスターをホストするプロジェクトを作成しています。

手順

  • クラスターをホストするプロジェクトで以下の必要な API サービスを有効にします。インストールに不要なオプションの API サービスを有効にすることもできます。GCP ドキュメントの サービスの有効化 を参照してください。

    表10.1 必要な API サービス
    API サービスコンソールサービス名

    Compute Engine API

    compute.googleapis.com

    Cloud Resource Manager API

    cloudresourcemanager.googleapis.com

    Google DNS API

    dns.googleapis.com

    IAM Service Account Credentials API

    iamcredentials.googleapis.com

    Identity and Access Management (IAM) API

    iam.googleapis.com

    Service Usage API

    serviceusage.googleapis.com

    表10.2 オプションの API サービス
    API サービスコンソールサービス名

    Cloud Deployment Manager V2 API

    deploymentmanager.googleapis.com

    Google Cloud API

    cloudapis.googleapis.com

    Service Management API

    servicemanagement.googleapis.com

    Google Cloud Storage JSON API

    storage-api.googleapis.com

    Cloud Storage

    storage-component.googleapis.com

10.4.3. GCP の DNS の設定

OpenShift Container Platform をインストールするには、使用する Google Cloud Platform (GCP) アカウントに、OpenShift Container Platform クラスターをホストする同じプロジェクトに専用のパブリックホストゾーンがなければなりません。このゾーンはドメインに対する権威を持っている必要があります。DNS サービスは、クラスターへの外部接続のためのクラスターの DNS 解決および名前検索を提供します。

手順

  1. ドメイン、またはサブドメイン、およびレジストラーを特定します。既存のドメインおよびレジストラーを移行するか、GCP または他のソースから新規のものを取得できます。

    注記

    新規ドメインを購入する場合、関連する DNS の変更が伝播するのに時間がかかる場合があります。Google 経由でドメインを購入する方法の詳細は、Google ドメイン を参照してください。

  2. GCP プロジェクトにドメインまたはサブドメインのパブリックホストゾーンを作成します。GCP ドキュメントの ゾーンの管理 を参照してください。

    openshiftcorp.com などのルートドメインや、clusters.openshiftcorp.com などのサブドメインを使用します。

  3. ホストゾーンレコードから新規の権威ネームサーバーを抽出します。GCP ドキュメントの Cloud DNS ネームサーバーを検索する を参照してください。

    通常は、4 つのネームサーバーがあります。

  4. ドメインが使用するネームサーバーのレジストラーレコードを更新します。たとえば、ドメインを Google ドメインに登録している場合は、Google Domains Help で How to switch to custom name servers のトピックを参照してください。
  5. ルートドメインを Google Cloud DNS に移行している場合は、DNS レコードを移行します。GCP ドキュメントの Cloud DNS への移行 を参照してください。
  6. サブドメインを使用する場合は、所属する会社の手順に従ってその委任レコードを親ドメインに追加します。このプロセスには、所属企業の IT 部門や、会社のルートドメインと DNS サービスを制御する部門へのリクエストが含まれる場合があります。

10.4.4. GCP アカウントの制限

OpenShift Container Platform クラスターは多くの Google Cloud Platform (GCP) コンポーネントを使用しますが、デフォルトの 割り当て (Quota) はデフォルトの OpenShift Container Platform クラスターをインストールする機能に影響を与えません。

3 つのコンピュートマシンおよび 3 つのコントロールプレーンマシンが含まれるデフォルトクラスターは以下のリソースを使用します。一部のリソースはブートストラッププロセス時にのみ必要となり、クラスターのデプロイ後に削除されることに注意してください。

表10.3 デフォルトのクラスターで使用される GCP リソース
サービスコンポーネント場所必要なリソースの合計ブートストラップ後に削除されるリソース

サービスアカウント

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

GCP コンソール からリソースクォータを増やすことは可能ですが、サポートチケットを作成する必要がある場合があります。OpenShift Container Platform クラスターをインストールする前にサポートチケットを解決できるように、クラスターのサイズを早期に計画してください。

10.4.5. GCP でのサービスアカウントの作成

OpenShift Container Platform には、Google API でデータにアクセスするための認証および承認を提供する Google Cloud Platform (GCP) サービスアカウントが必要です。プロジェクトに必要なロールが含まれる既存の IAM サービスアカウントがない場合は、これを作成する必要があります。

前提条件

  • クラスターをホストするプロジェクトを作成しています。

手順

  1. OpenShift Container Platform クラスターをホストするために使用するプロジェクトでサービスアカウントを作成します。GCP ドキュメントで サービスアカウントの作成 を参照してください。
  2. サービスアカウントに適切なパーミッションを付与します。付随する個別のパーミッションを付与したり、オーナー ロールをこれに割り当てることができます。特定のリソースのサービスアカウントへのロールの付与 を参照してください。

    注記

    サービスアカウントをプロジェクトの所有者にすることが必要なパーミッションを取得する最も簡単な方法になります。 つまりこれは、サービスアカウントはプロジェクトを完全に制御できることを意味します。この権限を提供することに伴うリスクが受け入れ可能であるかどうかを判別する必要があります。

  3. サービスアカウントキーを JSON 形式で作成するか、サービスアカウントを GCP 仮想マシンにアタッチできます。GCP ドキュメントの サービスアカウントキー作成とインスタンスのサービスアカウントの作成と有効 化をご覧ください。

    注記

    サービスアカウントがアタッチされた仮想マシンを使用してクラスターを作成する場合は、インストール前に install-config.yaml ファイルで credentialsMode: Manual を設定する必要があります。

10.4.6. 必要な GCP のロール

作成するサービスアカウントに オーナー ロールを割り当てると、OpenShift Container Platform のインストールに必要なパーミッションも含め、そのサービスアカウントにすべてのパーミッションが付与されます。組織のセキュリティーポリシーでより制限的なアクセス許可のセットが必要な場合は、次のアクセス許可を持つサービスアカウントを作成できます。クラスターを既存の VPC (virtual private cloud) にデプロイする場合、サービスアカウントでは一部のネットワークのパーミッションを必要としません。これについては、以下の一覧に記載されています。

インストールプログラムに必要なロール

  • Compute 管理者
  • ロール管理者
  • セキュリティー管理者
  • サービスアカウント管理者
  • サービスアカウントキー管理者
  • サービスアカウントユーザー
  • ストレージ管理者

インストール時のネットワークリソースの作成に必要なロール

  • DNS 管理者

Passthrough モードで Cloud Credential Operator を使用するために必要なロール

  • ロードバランサー計算の管理者

user-provisioned GCP インフラストラクチャーに必要なロール

  • Deployment Manager Editor

次のロールは、コントロールプレーンとコンピュートマシンが使用するサービスアカウントに適用されます。

表10.4 GCP サービスアカウントのロール
アカウントロール

コントロールプレーン

roles/compute.instanceAdmin

roles/compute.networkAdmin

roles/compute.securityAdmin

roles/storage.admin

roles/iam.serviceAccountUser

Compute

roles/compute.viewer

roles/storage.admin

roles/artifactregistry.reader

10.4.7. user-provisioned infrastructure に必要な GCP 権限

作成するサービスアカウントに オーナー ロールを割り当てると、OpenShift Container Platform のインストールに必要なパーミッションも含め、そのサービスアカウントにすべてのパーミッションが付与されます。

組織のセキュリティーポリシーで、より制限的なアクセス許可のセットが必要な場合は、必要なアクセス許可を持つ カスタムロール を作成できます。OpenShift Container Platform クラスターを作成および削除するには、user-provisioned infrastructure に以下のパーミッションが必要です。

例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.globalAddresses.create
  • compute.globalAddresses.get
  • compute.globalAddresses.use
  • compute.globalForwardingRules.create
  • compute.globalForwardingRules.get
  • 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

例10.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

例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
  • compute.regionHealthChecks.create
  • compute.regionHealthChecks.get
  • compute.regionHealthChecks.useReadOnly

例10.8 GCP ゾーンとリージョン関連の情報を取得するために必要な権限

  • compute.globalOperations.get
  • compute.regionOperations.get
  • compute.regions.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 サービスアカウントキーなしで認証する場合に必要な権限

  • iam.serviceAccounts.signBlob

例10.12 インストールに必要なイメージ権限

  • compute.images.create
  • compute.images.delete
  • compute.images.get
  • compute.images.list

例10.13 収集ブートストラップを実行するためのオプションの権限

  • compute.instances.getSerialPortOutput

例10.14 ネットワークリソースを削除するために必要な権限

  • 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

例10.15 ロードバランサーリソースを削除するために必要な権限

  • compute.backendServices.delete
  • compute.backendServices.list
  • compute.regionBackendServices.delete
  • compute.regionBackendServices.list
  • compute.targetPools.delete
  • compute.targetPools.list
  • compute.targetTcpProxies.delete
  • compute.targetTcpProxies.list

例10.16 DNS リソースを削除するために必要な権限

  • dns.changes.create
  • dns.managedZones.delete
  • dns.managedZones.get
  • dns.managedZones.list
  • dns.resourceRecordSets.delete
  • dns.resourceRecordSets.list

例10.17 サービスアカウントリソースを削除するために必要な権限

  • iam.serviceAccounts.delete
  • iam.serviceAccounts.get
  • iam.serviceAccounts.list
  • resourcemanager.projects.getIamPolicy
  • resourcemanager.projects.setIamPolicy

例10.18 コンピューティングリソースを削除するために必要な権限

  • 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.19 ストレージリソースの削除に必要

  • storage.buckets.delete
  • storage.buckets.getIamPolicy
  • storage.buckets.list
  • storage.objects.delete
  • storage.objects.list

例10.20 ヘルスチェックリソースを削除するために必要な権限

  • compute.healthChecks.delete
  • compute.healthChecks.list
  • compute.httpHealthChecks.delete
  • compute.httpHealthChecks.list
  • compute.regionHealthChecks.delete
  • compute.regionHealthChecks.list

例10.21 削除に必要なイメージ権限

  • compute.images.delete
  • compute.images.list

例10.22 リージョン関連の情報を取得するために必要な権限

  • compute.regions.get

例10.23 必要な 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. サポートされている GCP リージョン

OpenShift Container Platform クラスターを以下の Google Cloud Platform (GCP) リージョンにデプロイできます。

  • 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 の ドキュメント を参照してください。

10.4.9. GCP の CLI ツールのインストールおよび設定

user-provisioned infrastructure を使用して Google Cloud Platform (GCP) に OpenShift Container Platform をインストールするには、GCP の CLI ツールをインストールし、設定する必要があります。

前提条件

  • クラスターをホストするプロジェクトを作成しています。
  • サービスアカウントを作成し、これに必要なパーミッションを付与しています。

手順

  1. $PATH で以下のバイナリーをインストールします。

    • gcloud
    • gsutil

    GCP ドキュメントの Cloud SDK のドキュメント を参照してください。

  2. 設定したサービスアカウントで、gcloud ツールを使用して認証します。

    GCP ドキュメントで、サービスアカウントでの認証 を参照してください。

Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.