GoogleCloudPlatform / continuous-deployment-on-kubernetes

Get up and running with Jenkins on Google Kubernetes Engine
Apache License 2.0
1.59k stars 887 forks source link

403 on pushing image to GCR #161

Open fermelone opened 4 years ago

fermelone commented 4 years ago

Followed the guide here exactly, and I'm getting a 403 when Jenkins tries to upload the image to GCR using the command: gcloud builds submit -t ${IMAGE_TAG} .

Getting: `ERROR: (gcloud.builds.submit) HTTPError 403: Insufficient Permission``

However, I added a few gcloud commands before that, such as: gcloud container images list and it works, so I figured that it had to be the permissions on storage or buckets, but checked this in IAM and it seems to be ok, I can authenticate manually with the service account used, and I can upload things manually to GCR.

So my final thought is that the problem resides in the way Jenkins inherits gcloud accounts to execute stage commands.

Does anything sound familiar here? like a known issue? It's important to mention that the option Google service account from metadata does now work when adding new credentials in my Jenkins instance (also created with your guide). I had to upload a json key file to add credentials, and it seems to be working for all other commands, except the one I mentioned before, uploading images to GCR.

Thanks!

Juanmanuelramirez commented 3 years ago

did you solve it ? I got a similar error Failed to initialize HTTP transport: hudson.AbortException