Google Cloud Jenkins gcloud推送访问被拒绝 [英] Google Cloud Jenkins gcloud push access denied
问题描述
我正在通过Jenkins尝试将图像推送到容器存储库。它开始工作,但现在,我得到了访问被拒绝
docker - push gcr.io/xxxxxxx-yyyyy -138623 / myApp:master.1
推送引用存储库[gcr.io/xxxxxxx-yyyyy-138623/myApp]
bdc3ba7fdb96:准备
5632c278a6dc:等待
被拒绝: 拒绝访问。
Jenkinsfile看起来像:
<$ p $ (gcloud docker --authorize-only)
sh(docker - push gcr.io/xxxxxxx-yyyyy-138623/hotelpro4u:master.1)
备注:
我12个小时被卡住了......我需要帮助
这个错误意味着GKE节点没有权限推送到支持你的仓库的GCS桶。
这可能是因为:
- 群集没有正确的作用域来对GCS进行身份验证。您是否创建了集群w /
- 作用域storage-rw
? - 集群正在运行的服务帐户没有存储桶上的权限。查看 IAM&管理员部分,以确保服务帐户具有必要的角色。
I'm trying via Jenkins to push an image to the container repository. It was working at first, but now, I got "access denied"
docker -- push gcr.io/xxxxxxx-yyyyy-138623/myApp:master.1
The push refers to a repository [gcr.io/xxxxxxx-yyyyy-138623/myApp]
bdc3ba7fdb96: Preparing
5632c278a6dc: Waiting
denied: Access denied.
the Jenkinsfile look like :
sh("gcloud docker --authorize-only")
sh("docker -- push gcr.io/xxxxxxx-yyyyy-138623/hotelpro4u:master.1")
Remarks:
- Jenkins is running in Google Cloud
- If I try in Google Shell or from my computer, it's working
- I followed this tutorial : https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes
I'm stuck while 12 hours.... I need help
That error means that the GKE node is not authorized to push to the GCS bucket that is backing your repository.
This could be because:
- The cluster does not have the correct scopes to authenticate to GCS. Did you create the cluster w/
--scopes storage-rw
? - The service account that the cluster is running as does not have permissions on the bucket. Check the IAM & Admin section on your project to make sure that the service account has the necessary role.
这篇关于Google Cloud Jenkins gcloud推送访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!