本指南介绍如何在启用 Cloud Run for Anthos 的情况下设置 Anthos clusters on VMware (GKE On-Prem)。
请注意,安装 Cloud Run for Anthos on VMware 会将 Knative Serving 安装到集群中,以用于连接和管理无状态工作负载。
准备工作
- 此任务假定您拥有活跃的 VMware 上的 Anthos 集群 (GKE On-Prem)。了解如何创建 VMware 上的 Anthos 集群。
如需了解 Anthos,请参阅 Anthos 价格。
- 登录您的 Google Cloud 账号。如果您是 Google Cloud 新手,请创建一个账号来评估我们的产品在实际场景中的表现。新客户还可获享 $300 赠金,用于运行、测试和部署工作负载。
-
在 Google Cloud Console 中的项目选择器页面上,选择或创建一个 Google Cloud 项目。
-
在 Google Cloud Console 中的项目选择器页面上,选择或创建一个 Google Cloud 项目。
设置命令行环境
为 Cloud Run for Anthos on VMware 设置 gcloud CLI 和 kubectl
:
将 Google Cloud CLI 使用的默认 Google Cloud 项目设置为您刚创建的 Cloud 项目:
gcloud config set project PROJECT-ID
将 PROJECT_ID 替换为您的 Cloud 项目 ID。
安装
kubectl
命令行工具:gcloud components install kubectl
更新已安装的 gcloud CLI 组件:
gcloud components update
安装 Cloud Run for Anthos on VMware
通过在 config.yaml
文件中设置 cloudrun
配置,您可以在创建新的 Anthos clusters on VMware 集群时安装 Cloud Run for Anthos:
cloudrun: enabled: true
设置 Google Cloud 控制台
使用 Google Cloud 控制台时,请登录集群。如果您使用的是 Kubernetes 服务帐号,请务必向该服务帐号添加 cluster-admin
角色。