<p>For example, I have a pod running a server in it and I have a job in my cluster that is doing some yaml patching on the server deployment.</p>
<p>Is there a way we can set up some kind of trigger or anything that will rerun the job when ever the respective deployment change happens?</p>

Ankit Panigrahy
<p>You can add your job spec into the deployment as <code>initContainer</code> like that:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: example
spec:
  replicas: 1
  selector:
    matchLabels:
      app: example
  template:
    metadata:
      labels:
        app: example
    spec:
      initContainers:
      - name: init
        image: centos:7
        command:
        - &quot;bin/bash&quot;
        - &quot;-c&quot;
        - &quot;do something useful&quot;
      containers:
      - name: nginx
        image: nginx
</code></pre>
<p>In this case every time you rollout the deployment, job defined in <code>initContainers</code> will run.</p>
