配置 Google Cloud CLI

在使用 GKE on Azure 之前,您必须安装 Google Cloud CLI 并启用所需的 API。

如需配置 Google Cloud CLI,请运行以下命令:

  1. 使用以下命令检查您的 Google Cloud CLI 安装:

    gcloud version
    
  2. 如果未安装 Google Cloud CLI,或者其版本低于 402.0.0,请安装最新版本的 Google Cloud CLI

  3. 安装 kubectl 其他组件

  4. 创建 Google Cloud 项目(如果您尚未创建)。保存项目名称,稍后会用到该名称。

  5. 运行以下命令以对您的 Google Cloud 账号进行身份验证:

    gcloud auth login
    
  6. 使用以下命令启用 GKE Multi-Cloud API 及其服务依赖项。这些命令将为在 Google Cloud CLI 中配置的项目启用 API。

    gcloud services enable gkemulticloud.googleapis.com
    gcloud services enable gkeconnect.googleapis.com
    gcloud services enable gkehub.googleapis.com
    gcloud services enable connectgateway.googleapis.com
    gcloud services enable cloudresourcemanager.googleapis.com
    gcloud services enable anthos.googleapis.com
    gcloud services enable logging.googleapis.com
    gcloud services enable monitoring.googleapis.com
    gcloud services enable opsconfigmonitoring.googleapis.com
    

后续步骤