Google Cloud プロジェクトの構成

このページでは、GKE On-Prem をインストールする前に、Google Cloud プロジェクトを構成する方法について説明します。

GKE On-Prem をインストールするには、Anthos のサブスクリプションが必要です。Anthos のサブスクリプションがある場合は、次のことが完了しています。

  • Google Cloud プロジェクトを作成する。

  • 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 を有効にします。

Linux と macOS

gcloud services enable \
    anthos.googleapis.com \
    anthosgke.googleapis.com \
    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 ^
    anthos.googleapis.com ^
    anthosgke.googleapis.com ^
    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 の構成

デフォルトでは、Cloud Monitoring が GKE On-Prem で有効になっています。