I created a project on OpenShift 4.2 with an ImageStream that is pulling an Image from Quay.io:
oc new-project xxx-imagestream
oc import-image is:1.0 --from quay.io/xxx/myimage:latest --confirm --reference-policy local
Now I create a new project to host an app based on that ImageStream
oc new-project xxx-app
oc new-app --name myapp -i xxx-imagestream/is:1.0
The app is built and I can use it by exposing it. (But no Build or BuildConfig is created. Why???)
Now I update the image on Quay.io with a new version, and import the new version into the xxx-imagestream project:
oc import-image is:2.0 --from quay.io/xxx/myimage:latest --confirm --reference-policy local
The question is: how do I update my app (myapp)? In other words, how can I launch a new build of "myapp" based on the updated ImageStream?
A
BuildConfig
is only created when you use the "Source to Image" (S2I) functionality and is only needed when you want to create a container image from source. In your case, the image already exists, so there is no need to build anything. The only thing thatoc new-app
will do is deploy your existing image, there is no build necessary.You are looking for "Deployment triggers", specifically the "ImageChange deployment trigger". The ImageChange trigger results in a new
ReplicationController
whenever the content of animagestreamtag
changes (when a new version of the image is pushed).On a side-note, you can also periodically automate the importing of new image versions in your ImageStreams (see documentation).