Sharing of S2I based Image across Namespaces

1/26/2020

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
kubernetes
okd
openshift

1 Answer

1/31/2020

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
Source: StackOverflow