This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.8.3. Kubernetes リソースの自動的なトリガー
イメージストリームタグを更新して、Kubernetes リソースを自動的にトリガーできます。
以下の例では、トリガーは example:latest
イメージストリームタグの更新時に実行されます。実行時に、web
コンテナーの Pod テンプレートのイメージ参照が、オブジェクトの新しいイメージの値で更新されます。Pod テンプレートがデプロイメント定義の一部である場合には、Pod テンプレートへの変更によってデプロイメントが自動的にトリガーされ、新規イメージがロールアウトされます。
手順
以下の例に示すようにイメージストリームタグを更新して、Kubernetes リソースをトリガーします。
image.openshift.io/triggers=[{"from":{"kind":"ImageStreamTag","name":"example:latest"},"fieldPath":"spec.template.spec.containers[?(@.name='web')].image"}]
image.openshift.io/triggers=[{"from":{"kind":"ImageStreamTag","name":"example:latest"},"fieldPath":"spec.template.spec.containers[?(@.name='web')].image"}]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
デプロイメントが一時停止されない限り、この Pod テンプレートの更新により、デプロイメントはイメージの新規の値で自動的に実行されます。