How to use image stream in deploy configuration for OpenShift How to use image stream in deploy configuration for OpenShift kubernetes kubernetes

How to use image stream in deploy configuration for OpenShift


Are you constructing the resource definitions by hand?

It would be easier to use oc new-build and then oc new-app if you really need to set this up as two steps for some reason. If you just want to setup the build and deployment in one go, just use oc new-app.

For example, to setup build and deployment in one go use:

oc new-app --name myapp <repository-url>

To do it in two steps use:

oc new-build --name myapp <repository-url>oc new-app myapp

If you still rather use hand created resources, at least use the single step variant with the --dry-run -o yaml options to see what it would create for the image stream, plus build and deployment configuration. That way you can learn from it how to do it. The bit you currently have missing is an image stream.

BTW. It looks a bit suspicious that you have the entry point set to python3. That is highly unusual. What are you trying to do as right now it looks like you may be trying to do something in a way which may not work with how OpenShift works. OpenShift is mainly about long running processes and not for doing single docker run. You can do the latter, but not how you are currently doing it.