<p>I am using helm charts to deploy pods with a "ConfigMap" managing the configurations.</p>

<p>I edit ConfigMap directly to make changes to configuration files and then delete pods using kubectl delete, for the new configuration to take effect.</p>

<p>Is there any easy way using <strong>helm</strong> to replace a running pod with the new configuration without executing "<strong>kubectl delete</strong>" command</p>

<p>We have found that using <code>--recreate-pods</code> will immediately terminate all running pods of that deployment, meaning some downtime for your service. In other words, there will be no rolling update of your pods.</p>

<p>The issue to address this in Helm is still open: <a href="https://github.com/kubernetes/helm/issues/1702" rel="noreferrer">https://github.com/kubernetes/helm/issues/1702</a></p>

<p>Instead helm suggests adding a checksum of your configuration files to the deployment in an annotation. That way the deployment will have a different hash and essentially look 'new' to helm, causing it to update correctly.</p>

<blockquote>
  <p>The sha256sum function can be used to ensure a deployment's annotation section is updated if another file changes:</p>
</blockquote>

<pre><code>kind: Deployment
spec:
  template:
    metadata:
      annotations:
        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
[...]
</code></pre>

<p>From the docs here: <a href="https://helm.sh/docs/charts_tips_and_tricks/#automatically-roll-deployments-when-configmaps-or-secrets-change" rel="noreferrer">https://helm.sh/docs/charts_tips_and_tricks/#automatically-roll-deployments-when-configmaps-or-secrets-change</a></p>
