简体   繁体   English

add-iam-policy-binding 到 ESP 端点服务 GCloud 时出错

[英]error in add-iam-policy-binding to ESP end point service GCloud

I am trying to create an end point for an API to be deployed into existing GKE cluster by following the instructions in Getting started with Cloud Endpoints for GKE with ESPv2我正在尝试按照Getting started with Cloud Endpoints for GKE with ESPv2 中的说明,为要部署到现有 GKE 集群的 API 创建端点

I clone the sample code in the repo and modified the content of openapi.yaml:我在repo中克隆了示例代码并修改了openapi.yaml的内容:

# [START swagger]
swagger: "2.0"
info:
  description: "A simple Google Cloud Endpoints API example."
  title: "Endpoints Example"
  version: "1.0.0"
host: "my-api.endpoints.my-project.cloud.goog"

I then deployed it via the command:然后我通过命令部署它:

endpoints/getting-started (master) $ gcloud endpoints services deploy openapi.yaml

Now I can see that it has been created:现在我可以看到它已经创建:

$ gcloud endpoints services list
NAME                                                         TITLE
my-api.endpoints.my-project.cloud.goog

I also have postgreSQL service account:我也有 postgreSQL 服务帐户:

$ gcloud iam service-accounts list
DISPLAY NAME                   EMAIL                          DISABLED
my-postgresql-service-account  my-postgresql-service-acco@my-project.iam.gserviceaccount.com  False

In the section Endpoint Service Configuration of documentation it says to add the role to the attached service account for the endpoint service as follows, but I get this error:在文档的端点服务配置部分中,它说将角色添加到端点服务的附加服务帐户,如下所示,但我收到此错误:

$ gcloud endpoints services add-iam-policy-binding my-api.endpoints.my-project.cloud.goog 
--member serviceAccount:my-postgresql-service-acco@my-project.iam.gserviceaccount.com
--role roles/servicemanagement.serviceController
ERROR: (gcloud.endpoints.services.add-iam-policy-binding) User [myusername@mycompany.com] does not have permission to access services instance [my-api.endpoints.my-project.cloud.goog:getIamPolicy] (or it may not exist): No access to resource: services/my-api.my-project.cloud.goog

The previous lines show the service exits, I guess?前几行显示服务退出,我猜? Now I am not sure how to resolve this?现在我不确定如何解决这个问题? What permissions do I need?我需要什么权限? who can give me permission and what permissions he should have?谁能给我权限,他应该有什么权限? how can I check?我该如何检查? Is there any other solution?还有其他解决方案吗?

The issue got resolved after I was assigned the role of "Project_Admin".在我被分配“Project_Admin”角色后,问题得到了解决。 It was not ideal as it was giving too much permission to me.这并不理想,因为它给了我太多的许可。 The role "roles/endpoints.portalAdmin" was also tried but did not help.也尝试了角色“roles/endpoints.portalAdmin”,但没有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 gcloud iam service-accounts add-iam-policy-binding... NOT_FOUND:未知的服务帐户 - gcloud iam service-accounts add-iam-policy-binding ... NOT_FOUND: Unknown service account gcloud 对 add-iam-policy-binding 的混淆 - gcloud confusion around add-iam-policy-binding 从 gcloud projects add-iam-policy-binding 命令中抑制绑定 output - suppress bindings output from gcloud projects add-iam-policy-binding command 这个错误的根源是什么? 错误:(gcloud.run.services.add-iam-policy-binding)NOT_FOUND:未找到请求的实体 - What is the source of this error? ERROR: (gcloud.run.services.add-iam-policy-binding) NOT_FOUND: Requested entity was not found gcloud 关于为服务帐户设置/获取 IAM 政策的困惑 - gcloud confusion about set/get IAM policy for a service account 尝试获取 iam-policy gcloud 时出错 - Error when trying to get-iam-policy gcloud 如何使用 gcloud 命令工具将 GCP IAM 策略附加到资源? - How attach a GCP IAM policy to a resource with gcloud command tool? 将 IAM 策略绑定添加到 Google Pub/Sub 主题需要什么角色? - What is the role required to add an IAM policy binding to a Google Pub/Sub topic? gcloud iam service-accounts keys create 给出了无效的 jwt 签名错误 - gcloud iam service-accounts keys create gives invalid jwt signature error gcloud alpha 资源管理器文件夹 get-iam-policy 不起作用 - gcloud alpha resource-manager folders get-iam-policy is not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM