title: Adding insecure registry in containerd
body: <p>Trying to add insecure registry to containerd config as below:</p>
  <pre><code>[plugins.&quot;io.containerd.grpc.v1.cri&quot;.cni]
        bin_dir = &quot;/opt/cni/bin&quot;
        conf_dir = &quot;/etc/cni/net.d&quot;
        max_conf_num = 1
        conf_template = &quot;&quot;
      [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry]
        [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.mirrors]
          [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.mirrors.&quot;docker.io&quot;]
            endpoint = [&quot;https://registry-1.docker.io&quot;]
          [plugin.&quot;io.containerd.grpc.v1.cri&quot;.registry.mirrors.&quot;test.http-registry.io&quot;]
            endpoint = [&quot;http://v048011.dom600.lab:5000&quot;]
  </code></pre>
  <p>Even after adding it to <code>config.toml</code>, when pulling image from the insecure registry, it fails:</p>
  <pre><code>sudo ctr image pull v048011.dom600.lab:5000:5000/myjenkins:latest
  
  ctr: failed to resolve reference &quot;v048011.dom600.lab:5000/myjenkins:latest&quot;: failed to do request: Head https://v048011.dom600.lab:5000:5000/v2/myjenkins/manifests/latest: http: server gave HTTP response to HTTPS client
  </code></pre>
  <p>In <code>docker</code> we could just add the <code>insecure registry</code> to <code>daemon.json</code> file and docker would pull images from it, how can i achieve the same in <code>containerd</code> ?
  Replacing docker as runtime in k8s cluster.</p>