Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform 调用CloudRun的权限显然未授予GKE(pods)_Google Cloud Platform_Google Kubernetes Engine_Google Cloud Run_Google Iam - Fatal编程技术网

Google cloud platform 调用CloudRun的权限显然未授予GKE(pods)

Google cloud platform 调用CloudRun的权限显然未授予GKE(pods),google-cloud-platform,google-kubernetes-engine,google-cloud-run,google-iam,Google Cloud Platform,Google Kubernetes Engine,Google Cloud Run,Google Iam,我希望能够通过我的一个GKE pod调用GloudRun端点 当我描述构成GKE集群的VM/实例时,我看到 serviceAccounts: - email: 873099409230-compute@developer.gserviceaccount.com 因此,我将CloudRunInvoker角色添加到上述服务帐户中 我已启用需要身份验证的CloudRun 然而,当我执行到我的一个pod并尝试curl端点时,我得到了403(我也从我的笔记本电脑中得到了,但预期会是后者) 有什么建议吗

我希望能够通过我的一个GKE pod调用GloudRun端点

当我描述构成GKE集群的VM/实例时,我看到

serviceAccounts:
 - email: 873099409230-compute@developer.gserviceaccount.com
因此,我将CloudRunInvoker角色添加到上述服务帐户中

我已启用需要身份验证的CloudRun

然而,当我执行到我的一个pod并尝试
curl
端点时,我得到了
403
(我也从我的笔记本电脑中得到了,但预期会是后者)


有什么建议吗?

我不知道谷歌云安全。我的意思是,cURL不知道如何将安全令牌添加到您的请求中。为此,必须在请求头中显式添加令牌

从我的计算机上我使用这个,因为它是我的个人帐户,在Gcloud SDK中定义

curl -H "Authorization: Bearer $(gcloud config config-helper --format='value(credential.id_token)')" <URL>
curl-H“授权:承载$(gcloud-config-help-format='value(credential.id_-token)'”
使用gcloud中定义的服务帐户,可以使用以下命令

curl -H "Authorization: Bearer $(gcloud auth print-identity-token)" <URL>
curl-H“授权:持票人$(gcloud auth打印身份令牌)”
在这两种情况下,都必须将授权标头添加到请求中


在您的代码中,如果您使用谷歌库,您可以使用默认凭证,您的默认计算服务帐户将被使用。我不知道怎么做

我不知道谷歌云安全。我的意思是,cURL不知道如何将安全令牌添加到您的请求中。为此,必须在请求头中显式添加令牌

从我的计算机上我使用这个,因为它是我的个人帐户,在Gcloud SDK中定义

curl -H "Authorization: Bearer $(gcloud config config-helper --format='value(credential.id_token)')" <URL>
curl-H“授权:承载$(gcloud-config-help-format='value(credential.id_-token)'”
使用gcloud中定义的服务帐户,可以使用以下命令

curl -H "Authorization: Bearer $(gcloud auth print-identity-token)" <URL>
curl-H“授权:持票人$(gcloud auth打印身份令牌)”
在这两种情况下,都必须将授权标头添加到请求中

在您的代码中,如果您使用谷歌库,您可以使用默认凭证,您的默认计算服务帐户将被使用。我不知道怎么做