mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-07 09:46:53 +01:00
79 lines
2.4 KiB
Plaintext
79 lines
2.4 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * applications/deployments/managing-deployment-processes.adoc
|
|
|
|
[id="deployments-triggers_{context}"]
|
|
= Deployment triggers
|
|
|
|
A DeploymentConfig can contain triggers, which drive the creation of new
|
|
deployment processes in response to events inside the cluster.
|
|
|
|
[WARNING]
|
|
====
|
|
If no triggers are defined on a DeploymentConfig, a `ConfigChange`
|
|
trigger is added by default. If triggers are defined as an empty field, deployments
|
|
must be started manually.
|
|
====
|
|
|
|
[discrete]
|
|
[id="deployments-configchange-trigger_{context}"]
|
|
=== ConfigChange deployment triggers
|
|
|
|
The `ConfigChange` trigger results in a new ReplicationController whenever
|
|
configuration changes are detected in the Pod template of the DeploymentConfig.
|
|
|
|
[NOTE]
|
|
====
|
|
If a `ConfigChange` trigger is defined on a DeploymentConfig, the first
|
|
ReplicationController is automatically created soon after the DeploymentConfig
|
|
itself is created and it is not paused.
|
|
====
|
|
|
|
.ConfigChange deployment trigger
|
|
[source,yaml]
|
|
----
|
|
triggers:
|
|
- type: "ConfigChange"
|
|
----
|
|
|
|
[discrete]
|
|
[id="deployments-imagechange-trigger_{context}"]
|
|
=== ImageChange deployment triggers
|
|
|
|
The `ImageChange` trigger results in a new ReplicationController whenever the
|
|
content of an imagestreamtag changes (when a new version of the image is
|
|
pushed).
|
|
|
|
.ImageChange deployment trigger
|
|
[source,yaml]
|
|
----
|
|
triggers:
|
|
- type: "ImageChange"
|
|
imageChangeParams:
|
|
automatic: true <1>
|
|
from:
|
|
kind: "ImageStreamTag"
|
|
name: "origin-ruby-sample:latest"
|
|
namespace: "myproject"
|
|
containerNames:
|
|
- "helloworld"
|
|
----
|
|
<1> If the `imageChangeParams.automatic` field is set to `false`, the trigger is
|
|
disabled.
|
|
|
|
|
|
With the above example, when the `latest` tag value of the `origin-ruby-sample`
|
|
imagestream changes and the new image value differs from the current image
|
|
specified in the DeploymentConfig's `helloworld` container, a new
|
|
ReplicationController is created using the new image for the `helloworld`
|
|
container.
|
|
|
|
[NOTE]
|
|
====
|
|
If an `ImageChange` trigger is defined on a DeploymentConfig (with a
|
|
`ConfigChange` trigger and `automatic=false`, or with `automatic=true`) and the
|
|
`ImageStreamTag` pointed by the `ImageChange` trigger does not exist yet, then
|
|
the initial deployment process will automatically start as soon as an image is
|
|
imported or pushed by a build to the `ImageStreamTag`.
|
|
====
|