简体   繁体   English

使用 GCP 调试器但出现权限错误

[英]Use GCP debugger but got permission error

I add @google-cloud/debug-agent on my nodejs project which is deployed on GKE.我在部署在 GKE 上的 nodejs 项目中添加了@google-cloud/debug-agent
But I got error:但我得到了错误:

restify listening to http://[::]:80
@google-cloud/debug-agent Failed to re-register debuggee nodejs-bot: Error: The caller does not have permission
@google-cloud/debug-agent Failed to re-register debuggee nodejs-bot: Error: The caller does not have permission
@google-cloud/debug-agent Failed to re-register debuggee nodejs-bot: Error: The caller does not have permission
@google-cloud/debug-agent Failed to re-register debuggee nodejs-bot: Error: The caller does not have permission

I have checked my GKE have the debug permission.我已检查我的 GKE 是否具有调试权限。 I don't know why the service didn't have permission.我不知道为什么该服务没有权限。

在此处输入图片说明

Here is the code I define on my index.ts这是我在 index.ts 上定义的代码

import * as tracer from '@google-cloud/trace-agent';
tracer.start();
import * as debug from '@google-cloud/debug-agent';
debug.start();

This issue can be resolved by doing the following:可以通过执行以下操作来解决此问题:

1 - Create a new Cluster with these permissions enabled (ie Cloud Debugger/ Cloud Platform 'Enabled') and with the required scopes. 1 - 创建一个启用了这些权限(即云调试器/云平台“已启用”)和所需范围的新集群。 [1] [1]

Example:例子:

$ gcloud container clusters create example-cluster-name --scopes https://www.googleapis.com/auth/cloud_debugger --zone $ gcloud 容器集群创建 example-cluster-name --scopes https://www.googleapis.com/auth/cloud_debugger --zone

2- You can use the same YAML config files you used to deploy your original workloads in the new cluster. 2- 您可以使用用于在新集群​​中部署原始工作负载的相同 YAML 配置文件。 You must make sure you have the required scopes for this to work.您必须确保您拥有所需的范围才能使其工作。

You can review how authentication and scopes work using [2] [3] .您可以使用[2] [3]查看身份验证和范围的工作方式。

I found the issue is caused by workload identity, so I just close this feature to fix this issue.我发现问题是由工作负载身份引起的,所以我只是关闭了这个功能来解决这个问题。

Because I select to launch the workload identity feature.因为我选择启动工作负载身份功能。 Every pod which needs to connect GCP service will need to create a service account for these pods.每个需要连接 GCP 服务的 pod 都需要为这些 pod 创建一个服务帐户。 Otherwise, the permission will be blocked.否则,权限将被阻止。

https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity

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

相关问题 使用带有 bunyan 的堆栈驱动程序日志记录时,即使在 gcp 的 vm 实例中也会出现 PERMISSION_DENIED 错误 - Getting PERMISSION_DENIED error even inside gcp's vm instance when using stackdriver logging with bunyan GCP Kubernetes 所有日志都显示为错误日志 - GCP Kubernetes all logs apears as error logs 在Typescript中将Stackdriver调试器与云功能一起用于Firebase - Use Stackdriver debugger with cloud functions for Firebase in Typescript Go Stackdriver调试器错误加载程序 - Go Stackdriver debugger error loading program Google云端平台:GCP VM实例上的Stackdriver Agent安装和配置错误 - Google Cloud Platform : Stackdriver Agent installation and Condiguration error on GCP VM instance 当错误报告 GCP 中超过设置的限制发生相同错误时,如何创建警报? - How to create an alert when same error occurs for more than a set limit in Error Reporting GCP? 如何在GCP项目中授予用户访问Stackdriver Error Reporting的权限? - How do I grant a user access to Stackdriver Error Reporting in my GCP project? 错误:错误:(gcloud.logging.sinks.create)用户[nataraj @ somedomaindonamehere]没有访问组织的权限 - Error : ERROR: (gcloud.logging.sinks.create) User [nataraj@somedomaindonamehere] does not have permission to access organization Stackdriver GCP 中的日志保留 - Log retention in Stackdriver GCP 登录到GCP或本地 - Logging on either GCP or local
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM