我在尝试将映像部署到云运行时遇到权限错误:
gcloud beta run deploy endpoints_proxy \
--image="gcr.io/endpoints-release/endpoints-runtime-serverless:1.30.0" \
--allow-unauthenticated
这是错误:
ERROR: (gcloud.beta.run.deploy) User [email-goes-here] does not have permission to access namespace [project-id-goes-here] (or it may not exist): Cloud Run does not have permission to get access tokens for the default compute service account, [email protected] /cdn-cgi/l/email-protection. Please give Google Cloud Run Service Agent the permission iam.serviceAccounts.getAccessToken on the default compute service account.
我的帐户具有所有者和编辑者权限,我什至尝试附加 Cloud Run Service Agent 角色。
我还尝试将这些角色添加到错误中列出的“默认计算服务帐户”,但没有成功。
该错误消息非常具有误导性,发生该错误的原因是云运行服务代理失踪。
创建以下服务帐户后:
Name: service-<account-id>@serverless-robot-prod.iam.gserviceaccount.com
Role: Google Cloud Run Service Agent
问题解决了。看起来 Cloud Run 需要此服务帐户才能工作,所以永远不要删除它:)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)