<p>I'm using k3s to deploy my cluster, in my worker node I already setup insecure registries in /etc/docker/daemon.json for an internal network private registry</p>
<pre><code>{ &quot;insecure-registries&quot;: [&quot;192.168.30.87:7111&quot;] }
</code></pre>
<p>and I have restarted both my docker and my machine. I can see the settings from <code>docker info</code>
<a href="https://i.stack.imgur.com/LlCo7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LlCo7.png" alt="enter image description here" /></a></p>
<p>when I ran</p>
<pre><code>docker run 192.168.30.87:7111/linhnvh/user-service-image:latest
</code></pre>
<p>it worked perfectly</p>
<p>But I also set the image within my kubernetes deployment
<a href="https://i.stack.imgur.com/HeMk3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HeMk3.png" alt="enter image description here" /></a></p>
<p>when I apply the deployment I'm getting the following error:</p>
<p><a href="https://i.stack.imgur.com/pAELL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pAELL.png" alt="enter image description here" /></a></p>
<p>Why is this still not working within my kubernetes cluster? I can run <code>docker run</code> normally on the worker node with the image url</p>
<p><a href="https://i.stack.imgur.com/tqRa8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tqRa8.png" alt="enter image description here" /></a></p>
<p>it just doesn't work for kubernetes deployment? The <code>insecure-registries</code> settings is there in docker info</p>
<p>As I'm coding on a streaming machine so I can't copy paste images.</p>

<p>finally after 4 hours of searching i finally come into this issue <a href="https://github.com/k3s-io/k3s/issues/1802" rel="nofollow noreferrer">https://github.com/k3s-io/k3s/issues/1802</a></p>
<p>Because i'm using k3s for cluster setup it's using crictl instead of docker, so the daemon.json doesn't apply
which bring me to this documentation <a href="https://rancher.com/docs/k3s/latest/en/installation/private-registry/" rel="nofollow noreferrer">https://rancher.com/docs/k3s/latest/en/installation/private-registry/</a></p>
<p>i created <code>registries.yaml</code> in at /etc/rancher/k3s/ with the following content:</p>
<pre><code>mirrors:
  &quot;192.168.30.87:7111&quot;:
    endpoint:
      - &quot;http://192.168.30.87:7111&quot;
</code></pre>
<p>after saving i restart the k3s service with <code>systemctl restart k3s</code></p>
<p>after that my pod able to pull the image, remember to set the ip both and after <code>endpoint</code> in registries.yaml</p>
<p>This need to be set on all node that gonna create a pod, and the restart command of service will be different</p>
<p>on master node: <code>systemctl restart k3s</code></p>
<p>on worker/agent node: <code>systemctl restart k3s-agent</code></p>
