You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To enable Kubernetes resources, such as `Deployments` and `StatefulSets`, to seamlessly consume new image versions, configure image stream change triggers in {product-title}. This ensures your application deployments are automatically updated when the associated image stream detects a change.
11
+
9
12
Kubernetes resources do not have fields for triggering, unlike deployment and build configurations, which include as part of their API definition a set of fields for controlling triggers. Instead, you can use annotations in {product-title} to request triggering.
<1> Required: `kind` is the resource to trigger from must be `ImageStreamTag`.
35
-
<2> Required: `name` must be the name of an image stream tag.
36
-
<3> Optional: `namespace` defaults to the namespace of the object.
37
-
<4> Required: `fieldPath` is the JSON path to change. This field is limited and accepts only a JSON path expression that precisely matches a container by ID or index. For pods, the JSON path is `spec.containers[?(@.name='web')].image`.
38
-
<5> Optional: `paused` is whether or not the trigger is paused, and the default value is `false`. Set `paused` to `true` to temporarily disable this trigger.
37
+
where:
38
+
39
+
`kind`:: Specifies the resource to trigger from, and must have the value `ImageStreamTag`.
40
+
`name`:: Specifies the name of an image stream tag.
41
+
`namespace`:: Specifies the namespace of the object. This field is optional.
42
+
`fieldPath`:: Specifies the JSON path to change. This field is limited and accepts only a JSON path expression that precisely matches a container by ID or index. For pods, the JSON path is `spec.containers[?(@.name='web')].image`.
43
+
`paused`:: Specifies whether or not the trigger is paused. This field is optional, and defaults to the value `false`. Set the value to `true` to temporarily disable this trigger.
39
44
40
45
When one of the core Kubernetes resources contains both a pod template and this annotation, {product-title} attempts to update the object by using the image currently associated with the image stream tag that is referenced by trigger. The update is performed against the `fieldPath` specified.
= Setting the image trigger on Kubernetes resources
9
9
10
+
[role="_abstract"]
11
+
To enable automatic updates for your deployed applications managed by Kubernetes, use the command-line interface (CLI) to set an image stream change trigger on Kubernetes resources. This ensures that resources, like `Deployments` and `StatefulSets`, are automatically invoked when a new version of an upstream image is available.
12
+
10
13
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.
0 commit comments