<p>I have a small script running in a Pod that pokes for the latest App images (<code>dashboard:development</code>) in my registry and then pushes them to the Nodes running (via a daemonset).</p>
<p>This <strong>does work</strong>, as seen below.</p>
<p>Now, I would assume that once an App pod (like <code>sp-pod-xx</code>) requests this image, kubelet should not try to re-pull the image, even if <code>imagePullPolicy: Always</code> is set. As the <a href="https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy" rel="nofollow noreferrer">docs</a> say, kubelet compares the digest and only pulls, if there is a mismatch:</p>
<blockquote>
<p><strong>Always:</strong>
every time the kubelet launches a container, the kubelet queries the container image registry to resolve the name to an image digest. If the kubelet has a container image with that exact digest cached locally, the kubelet uses its cached image; otherwise, the kubelet pulls the image with the resolved digest, and uses that image to launch the container.</p>
</blockquote>
<p>But, even though the digests are identical (I did verify this), kubelet still re-pulls the image anyway. The App pod and the Daemonset pods are running on the same nodes too.</p>
<p>Any idea why?</p>
<p>Event logs:</p>
<pre><code>4m5s        Normal   Killing             pod/image-puller-ds-ldbfz                         
3m57s       Normal   SuccessfulCreate    daemonset/image-puller-ds                         Created pod: image-puller-ds-fcmts
3m57s       Normal   SuccessfulCreate    daemonset/image-puller-ds                         Created pod: image-puller-ds-fhhds
3m57s       Normal   Pulled              pod/image-puller-ds-fhhds                         Successfully pulled image &quot;dashboard:development&quot; in 192.717161ms
3m57s       Normal   Pulling             pod/image-puller-ds-fhhds                         Pulling image &quot;dashboard:development&quot;
3m56s       Normal   Started             pod/image-puller-ds-fhhds                         Started container image-puller
3m56s       Normal   Created             pod/image-puller-ds-fcmts                         Created container image-puller
3m56s       Normal   Created             pod/image-puller-ds-fhhds                         Created container image-puller
3m56s       Normal   Started             pod/image-puller-ds-fcmts                         Started container image-puller
3m56s       Normal   Pulled              pod/image-puller-ds-fhhds                         Container image &quot;pause:0.0.1&quot; already present on machine
3m55s       Normal   Created             pod/image-puller-ds-fcmts                         Created container pause
3m55s       Normal   SuccessfulDelete    daemonset/image-puller-ds                         Deleted pod: image-puller-ds-xt9vv
3m55s       Normal   Pulled              pod/image-puller-ds-fcmts                         Container image &quot;pause:0.0.1&quot; already present on machine
3m55s       Normal   Created             pod/image-puller-ds-fhhds                         Created container pause
3m55s       Normal   Started             pod/image-puller-ds-fhhds                         Started container pause
3m55s       Normal   Started             pod/image-puller-ds-fcmts                         Started container pause
3m55s       Normal   Killing             pod/image-puller-ds-xt9vv                         Stopping container pause
3m54s       Normal   Killing             pod/image-puller-ds-wgwzh                         Stopping container pause
3m54s       Normal   SuccessfulDelete    daemonset/image-puller-ds                         Deleted pod: image-puller-ds-wgwzh
3m25s       Normal   Pulling             pod/sp-pod-f3884032-1164-48e8-8213-c0c3856e573d   Pulling image &quot;dashboard:development&quot;
3m25s       Normal   Pulled              pod/sp-pod-f3884032-1164-48e8-8213-c0c3856e573d   Successfully pulled image &quot;dashboard:development&quot; in 220.610781ms
3m25s       Normal   Created             pod/sp-pod-f3884032-1164-48e8-8213-c0c3856e573d   Created container sp-container-f3884032-1164-48e8-8213-c0c3856e573d
3m25s       Normal   Started             pod/sp-pod-f3884032-1164-48e8-8213-c0c3856e573d   Started container sp-container-f3884032-1164-48e8-8213-c0c3856e573d
</code></pre>
<p>Versions:</p>
<pre><code>Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;22&quot;, GitVersion:&quot;v1.22.0&quot;, GitCommit:&quot;c2b5237ccd9c0f1d600d3072634ca66cefdf272f&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2021-08-04T18:03:20Z&quot;, GoVersion:&quot;go1.16.6&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;23&quot;, GitVersion:&quot;v1.23.12&quot;, GitCommit:&quot;f941a31f4515c5ac03f5fc7ccf9a330e3510b80d&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2022-11-09T17:12:33Z&quot;, GoVersion:&quot;go1.17.13&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>

Bennimi
<p>The docs are wrong. You can read the <a href="https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/preflight/checks.go#L848" rel="nofollow noreferrer">source code here</a>. The policy <code>PullIfNotPresent</code> would check if the image exists, but <code>Always</code> skips directly to pulling the image.</p>
