如何为监控 Google Cloud 创建服务账号
ManageEngine Site24x7 支持在以下两个层级监控您的 Google Cloud 资源:
- 组织
- 项目
组织级监控可监控该组织下的所有项目、文件夹和资源。项目级监控仅监控该项目下的资源。本帮助文档提供以下操作说明:
为组织监控创建服务账号
注意
请确保您拥有以下任一权限,以便分配所需角色:
- Project IAM Admin(或更高级别)
- Folder Admin
- Organization Administrator
- 登录 Google Cloud 控制台。
- 导航到您要监控的某个项目,单击 IAM & Admin > Service Accounts。
- 单击 Create service account。
- 为服务账号提供合适的名称,然后单击 Create and continue。
- 为服务账号分配以下角色:
- Browser
- Viewer
- 单击 Continue > Done。
- 导航到 Google Cloud 控制台的 IAM 页面。
- 选择要监控的项目、文件夹或组织。
- 要授予角色,单击 Grant access,然后输入您刚创建的服务账号的电子邮件地址。
- 分配以下角色:
- Browser
- Viewer
- 单击 Save。
注意
重复步骤 7-11,为所有要监控的项目、文件夹和组织授予访问权限。
如果您已在组织级别授予角色,这些角色将自动向下级联到该组织下的所有项目和文件夹,无需为这些项目和文件夹重复操作。
如果您已在组织级别授予角色,这些角色将自动向下级联到该组织下的所有项目和文件夹,无需为这些项目和文件夹重复操作。
创建并导出服务账号密钥
- 登录 Google Cloud 控制台。
- 导航至 IAM & Admin > Service Accounts。
- 选择您创建的服务账号。
- 选择 Keys > Add key > Create new key > JSON。
- 单击 Create。
- 登录您的 Site24x7 账户。
- 在添加 GCP 监视器页面中,单击 服务账号选项卡。
- 单击 Upload a Service Account JSON File,将密钥上传到您的 Google Cloud 服务账号。
服务账号密钥将以 JSON 格式下载。请在 Site24x7 的添加 GCP 监视器页面中根据提示上传此 JSON 密钥文件。
为项目监控创建服务账号
- 登录 Google Cloud 控制台。
- 导航到您要监控的项目。
- 单击 IAM & Admin > Service Accounts。
- 单击 Create service account。
- 为服务账号提供合适的名称,然后单击 Create and continue。
- 导航到权限选项卡。
- 为服务账号分配以下角色:
- Browser
- Viewer
- 单击 Continue > Done。
- 导航到密钥选项卡,按照以下说明导出服务账号密钥。
- 选择 Keys > Add key > Create new key > JSON。
- 单击 Create。
监控所需启用的 API
- "compute.googleapis.com"
- "cloudfunctions.googleapis.com"
- "dataproc.googleapis.com"
- "redis.googleapis.com"
- "container.googleapis.com"
- "spanner.googleapis.com"
- "appengine.googleapis.com"
- "pubsub.googleapis.com"
- "composer.googleapis.com"
- "monitoring.googleapis.com"
- "compute.googleapis.com"
- "sqladmin.googleapis.com"
- "dataflow.googleapis.com"
- "run.googleapis.com"
- "file.googleapis.com"
- "cloudkms.googleapis.com"
- "dns.googleapis.com"
- "cloudbilling.googleapis.com"
- "cloudresourcemanager.googleapis.com"
- "cloudasset.googleapis.com"
- "servicenetworking.googleapis.com"
- "appengine.googleapis.com"
- "container.googleapis.com"
- "cloudkms.googleapis.com"
通常这些 API 默认已启用。如果您需要手动启用,请等待 5-10 分钟,待更改应用至 Site24x7 后再操作。
如果您希望通过 Terraform 启用这些 API,请使用知识库文档中提供的 Terraform 示例脚本。
常见问题 {单击展开}
1. 项目级监控和组织级监控哪个更好?
如果一个组织下有很多项目和文件夹,建议选择组织级监控,因为只要为 Site24x7 提供最低所需访问权限,所有项目将被自动发现并添加到监控中。如果您的资源仅位于一个项目下,且短期内不打算添加更多项目,则项目级监控已足够。
2. Site24x7 是否需要其他权限?
除了监控 20 余种 Google Cloud 资源外,您还可以通过 Site24x7 执行管理操作,如启动或停止 VM。要执行管理操作,您需要知识库文档中列出的额外权限。
3. 为什么在我的 Site24x7 账户中看不到 Google Cloud 监视器?
Google Cloud 监视器未在 Site24x7 账户中列出的最常见原因,已在我们的知识库文档中进行了说明。
