Google Cloud Jenkins gcloud推送访问被拒绝 [英] Google Cloud Jenkins gcloud push access denied

查看:381
本文介绍了Google Cloud Jenkins gcloud推送访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过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桶。



这可能是因为:


  1. 群集没有正确的作用域来对GCS进行身份验证。您是否创建了集群w / - 作用域storage-rw

  2. 集群正在运行的服务帐户没有存储桶上的权限。查看 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:

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:

  1. The cluster does not have the correct scopes to authenticate to GCS. Did you create the cluster w/ --scopes storage-rw?
  2. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆