8.3. Setting the image trigger on Kubernetes resources
When adding an image trigger to deployments, you can use the oc set triggers
command. For example, the sample command in this procedure adds an image change trigger to the deployment named example
so that when the example:latest
image stream tag is updated, the web
container inside the deployment updates with the new image value. This command sets the correct image.openshift.io/triggers
annotation on the deployment resource.
Procedure
Trigger Kubernetes resources by entering the
oc set triggers
command:$ oc set triggers deploy/example --from-image=example:latest -c web
Unless the deployment is paused, this pod template update automatically causes a deployment to occur with the new image value.