このページでは、GKE On-Prem をインストールする前に、Google Cloud プロジェクトを構成する方法について説明します。
GKE On-Prem をインストールするには、Anthos のサブスクリプションが必要です。Anthos のサブスクリプションがある場合は、次のことが完了しています。
- Google Cloud プロジェクトを作成する。
- Google Cloud プロジェクトが許可リストに登録されている。
- Google アカウントが許可リストに登録されている。
- 必要に応じてチームメンバーの個々の Google アカウントを許可リストに登録されている。
- Google Cloud プロジェクトでサービス アカウントが作成されていて、サービス アカウントが許可リストに登録されている。GKE On-Prem のドキュメントでは、このサービス アカウントは許可リストに登録されたサービス アカウントと呼ばれます。
ログイン
アカウントの認証情報を使用して Google Cloud にログインします。
gcloud auth login
デフォルトのプロジェクト ID の設定
次のコマンドを入力して、デフォルトのプロジェクト ID を設定します。
gcloud config set project [PROJECT_ID]
ここで、[PROJECT_ID] はプロジェクト ID です。
デフォルトのプロジェクト ID を設定したので、gcloud
コマンドに --project
フラグを指定する必要はありません。
プロジェクトで必要な API を有効にする
Google Cloud プロジェクトで次の API を有効にする必要があります。
- cloudresourcemanager.googleapis.com
- container.googleapis.com
- gkeconnect.googleapis.com
- gkehub.googleapis.com
- serviceusage.googleapis.com
- stackdriver.googleapis.com
- monitoring.googleapis.com
- logging.googleapis.com
こうした API を有効にするには、次のコマンドを実行します。
Linux / macOS
gcloud services enable \ cloudresourcemanager.googleapis.com \ container.googleapis.com \ gkeconnect.googleapis.com \ gkehub.googleapis.com \ serviceusage.googleapis.com \ stackdriver.googleapis.com \ monitoring.googleapis.com \ logging.googleapis.com
Windows
gcloud services enable ^ cloudresourcemanager.googleapis.com ^ container.googleapis.com ^ gkeconnect.googleapis.com ^ gkehub.googleapis.com ^ serviceusage.googleapis.com ^ stackdriver.googleapis.com ^ monitoring.googleapis.com ^ logging.googleapis.com
Cloud Monitoring の構成
GKE On-Prem では、Cloud Logging と Cloud Monitoring がデフォルトで有効になっています。