如何在另一个项目中创建一个 GKE 节点池 运行 作为服务帐户?
How to create a GKE node pool running as a service account in another project?
我有两个 GCP 项目,A 和 B,我想在项目 B 中创建一个集群,并在项目 B 运行 中创建一个节点池作为项目 A 中的服务帐户。
我可以创建集群,但是当我尝试创建节点池时出现以下错误:
The user does not have access to service account: gke-node@project-A.iam.gserviceaccount.com. Ask a project owner to grant you the iam.serviceAccountUser role on the service account.
我已经为项目 B 的 Kubernetes 代理服务帐户 (service-<project-B-number>@container-engine-robot.iam.gserviceaccount.com
) 赋予项目 A 中 gke-node@project-A.iam.gserviceaccount.com
的 iam.serviceAccountUser 角色,但这似乎不起作用。
这可以吗?
我 post 这个社区 wiki 的回答是为了让评论部分提供的解决方案更加可见。随意更改或扩展。
正如 @Gari Singh 所建议的那样,您应该遵循 documentation. The root cause of an issue accordingly to @dippynark was that the iam.disableCrossProjectServiceAccountUsage
constraint is enabled. Here 您可以找到更多详细信息。
我有两个 GCP 项目,A 和 B,我想在项目 B 中创建一个集群,并在项目 B 运行 中创建一个节点池作为项目 A 中的服务帐户。
我可以创建集群,但是当我尝试创建节点池时出现以下错误:
The user does not have access to service account: gke-node@project-A.iam.gserviceaccount.com. Ask a project owner to grant you the iam.serviceAccountUser role on the service account.
我已经为项目 B 的 Kubernetes 代理服务帐户 (service-<project-B-number>@container-engine-robot.iam.gserviceaccount.com
) 赋予项目 A 中 gke-node@project-A.iam.gserviceaccount.com
的 iam.serviceAccountUser 角色,但这似乎不起作用。
这可以吗?
我 post 这个社区 wiki 的回答是为了让评论部分提供的解决方案更加可见。随意更改或扩展。
正如 @Gari Singh 所建议的那样,您应该遵循 documentation. The root cause of an issue accordingly to @dippynark was that the iam.disableCrossProjectServiceAccountUsage
constraint is enabled. Here 您可以找到更多详细信息。