<p>i have a daemonset where the pods are getting their configuration from a configmap, so i wanted to automatically restart the daemonset when i update the configmap.
i saw this in helm docs: <a href="https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments" rel="nofollow noreferrer">https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments</a>
so i ended up putting this in my code:</p>
<pre><code>apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fluentd-logzio
  namespace: fluentd
  annotations:
    config: {{ include (print $.Template.BasePath &quot;/configmap.yaml&quot;) . | sha256sum }}
  labels:
    k8s-app: fluentd-logzio
    version: v1
spec:
  selector:
    matchLabels:
      k8s-app: fluentd-logzio
  template:
    metadata:
      labels:
        k8s-app: fluentd-logzio
        version: v1
    [...]
</code></pre>
<p>the annotation updates successfully but the daemonset won't restart. is it because it's not a deployment? i tried changing deployment annotation using <code>kubectl edit</code> and it also didn't trigger a restart.</p>

ConscriptMR
<p>You need to put the annotation on the pod template, not the daemonset:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fluentd-logzio
  namespace: fluentd
  labels:
    k8s-app: fluentd-logzio
    version: v1
spec:
  selector:
    matchLabels:
      k8s-app: fluentd-logzio
  template:
    metadata:
      labels:
        k8s-app: fluentd-logzio
        version: v1
      annotations:
        config: {{ include (print $.Template.BasePath &quot;/configmap.yaml&quot;) . | sha256sum }}
    [...]
</code></pre>
<p>that way the pod config changes and the pods will be recreated.</p>
