在 Telecom Network Automation 中执行操作之前,您必须先设置Google Cloud 项目。如需设置项目,请完成以下步骤。
准备工作
在继续之前,请务必做好以下准备:
最新版本的
gcloud命令行界面 (CLI) 工具。执行以下其中一项操作:- 如需了解完整的安装说明,请参阅安装 gcloud CLI。
使用以下命令更新现有版本:
gcloud components update
确认您拥有
kubectlCLI 的 1.25.8 版。在目标位置有一个或多个 GDC 机架。
- 软件必须运行 1.5.0 版。如需了解详情,请参阅安装要求。
设置 Google Cloud 项目
在预配 Telecom Network Automation 之前,您必须设置 Google Cloud 项目:
设置默认项目:
gcloud config set project PROJECT_NAME将 PROJECT_NAME 替换为您的项目名称。
在默认项目中,启动 GKE 计算端点:
gcloud services enable compute.googleapis.com分配环境变量:
export PROJECT_ID=$(gcloud config get-value project) export PROJECT_NUM=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)") export LOCATION=ZONE # create a /workdir to clone all repositories mkdir ~/workdir cd ~/workdir将 ZONE 替换为离您最近的可用区,例如
us-central1-a。为组织中的用户分配 IAM 角色,以授予对 Google Cloud 项目的权限:
gcloud projects add-iam-policy-binding $PROJECT_ID --member='user:EMAIL' --role='ROLE'替换以下内容:
- EMAIL:要将角色绑定到的用户的电子邮件地址。
- ROLE:角色的名称。
例如
roles/owner。如需查看 Telecom Network Automation 角色的完整列表,请参阅架构和权限。
在项目中启用 Telecom Network Automation 端点:
gcloud services enable telcoautomation.googleapis.com设置默认
gcloud超时时间:gcloud config set http_timeout 3600通过向有限访问权限的电信网络自动化监控组授予日志查看器角色,解决电信网络自动化部署问题:
gcloud projects add-iam-policy-binding $PROJECT_ID --member=group:cloud-gmec-tna-monitoring-team@twosync.google.com --role=roles/logging.viewer