Sharing docker registry images among gcloud projects

7/13/2016

We're hoping to use a google project to share docker images containing microservices across projects.

I was thinking I could do it using the kubernetes run command and pull an image from a project other than the current one:

kubectl run  gdrive-service --image=us.gcr.io/foo/gdrive-service 

My user credentials have access to both projects. However, it seems like the run command can only pull mages from the current project.

Is there an approach for doing this? It seems like an obvious use case.

-- Robert Moskal
docker
gcloud
google-container-registry
google-kubernetes-engine
kubernetes

2 Answers

7/13/2016

There are a few options here.

  1. Use _json_key auth described here with Kubernetes pull secrets.

  2. This describes how to add robots across projects as well, still without needing pull secrets.

-- mattmoor
Source: StackOverflow

8/7/2017

In my answer here I describe a way to do this by granting the GKE service account user Storage Object Viewer permission under the project that contains the registry.

-- AllSySt3msG0
Source: StackOverflow