<p>The <a href="https://helm.sh/docs/howto/charts_tips_and_tricks/" rel="nofollow noreferrer">helm documentation</a> suggests to <strong>recreate a pod</strong> by setting variable metadata values.</p>
<p>For example:</p>
<pre><code>kind: Deployment
spec:
  template:
    metadata:
      annotations:
        checksum/config: {{ include (print $.Template.BasePath &quot;/configmap.yaml&quot;) . | sha256sum }}
[...]
</code></pre>
<p>But there a <strong>situations</strong>, when a pod is <strong>not</strong> recreated:</p>
<ul>
<li>A pod is erroneous in state <code>CrashLoopBackOff</code></li>
<li>Only Deployment Metadata has changed</li>
</ul>
<p>I would like to know <strong>what events</strong> do trigger a pod recreate:</p>
<ul>
<li>Why is the pod in state <code>CrashLoopBackOff</code> not restarted?</li>
<li>Why are not all parts of the spec considered to recreate the pod?</li>
</ul>
<p><strong>Edit</strong></p>
<p>The <code>CrashLookBackOff</code> is an application problem.
But if a new image (containing the bugfix) is provided, the pod should be restarted without the need to kill it explicitly.</p>
<p>Is there a cause not to restart the <code>CrashLookBackOff</code> pod?</p>

<p>The <em>template</em> in a <code>Deployment</code> is a <code>PodTemplate</code>. Every time the PodTemplate is changed, a new ReplicaSet is created, and it creates new Pods according to the number of replicas using the PodTemplate.</p>
<pre><code>kind: Deployment
spec:
  template:
    # any change here will lead to new Pods
</code></pre>
<p>Everytime a new Pod is created from a template, it will be identical as the previous pods.</p>
<p>A <code>CrashLoopBackOff</code> is a Pod-level problem, e.g. it may be a problem with the application.</p>
<blockquote>
<p>But if a new image (containing the bugfix) is provided, the pod should be restarted without the need to kill it explicitly.</p>
</blockquote>
<p>If a new image is provided, it should have its own unique name. That means that whenever you change the image, you have to change the image name. A change of the image name is a change in the PodTemplate, so it will always create new Pods - and delete but not reuse old Pods.</p>
