0

If an image is created during an S2I process in one namespace and saved to image stream in that same namespace, can it be shared with another namespace in OpenShift?

I am trying to see if I can avoid a second build and reuse the first image created if the custom resource I submitted for the first and second builds are identical to each other (maybe namespace is different). If yes, how does one go about discovering this across the cluster?

Ramesh Reddy
  • 554
  • 1
  • 3
  • 8
  • 1
    Seems this will work for you [pull-from-other-namespace](https://stackoverflow.com/questions/45727200/how-to-allow-image-pull-from-one-project-to-another-in-openshift) – ankidaemon Jan 26 '20 at 02:33
  • 1
    Or you can push the image to `openshift` project which is shared with all projects. – Daein Park Jan 26 '20 at 05:53

1 Answers1

0

Generally S2I images are stored in openshift namespace, which is shared. If you need images from other namespace, you can assign role.

oc policy add-role-to-user edit system:serviceaccount:<current_project>:default -n <namespace>

or

oc policy add-role-to-user system:image-puller system:serviceaccount:<namespace>:default --namespace=<namespace>
sharmag
  • 189
  • 2
  • 7