<p>There is no requirement for secure registry. I just need to connect to a registry using http protocol.</p>
<p>The registry must be on a pod and not directly on the VM.</p>
<p>docker has <code>registry</code> image that is made just for this purpose but when I'm using it inside a pod, docker fails to communicate with it because it thinks its a secure registry:</p>
<pre><code>&gt; docker pull 192.168.64.3:31549/repo630444582240256/image1

Using default tag: latest
Error response from daemon: Get https://192.168.64.3:31549/v2/: http: server gave HTTP response to HTTPS client
</code></pre>
<hr />
<p>I came across these solutions but each of them requires installing prerequisits in the VM or doesn't use a pod to setup a registry:</p>
<ul>
<li><a href="https://github.com/SeldonIO/k8s-local-docker-registry" rel="nofollow noreferrer">https://github.com/SeldonIO/k8s-local-docker-registry</a></li>
<li><a href="https://github.com/alexellis/k8s-tls-registry" rel="nofollow noreferrer">https://github.com/alexellis/k8s-tls-registry</a></li>
<li><a href="https://github.com/ContainerSolutions/trow" rel="nofollow noreferrer">https://github.com/ContainerSolutions/trow</a></li>
</ul>
<hr />
<pre><code>&gt; set -x &amp;&amp; curl -X GET 192.168.64.3:31549/v2/_catalog

+ curl -X GET 192.168.64.3:31549/v2/_catalog
{&quot;repositories&quot;:[]}
</code></pre>

<p>I tried this on my local machine: <a href="https://github.com/SeldonIO/k8s-local-docker-registry" rel="nofollow noreferrer">https://github.com/SeldonIO/k8s-local-docker-registry</a> and works like a charm. (<a href="https://github.com/raravena80/k8s-docker-private-registry" rel="nofollow noreferrer">I had to make a few changes to the K8s manifests so they support the latest K8s</a>)</p>
<p>You can get to the registry using <code>curl -X GET 192.168.64.3:31549/v2/_catalog</code> which means there is no redirect to https.</p>
<p>I believe your docker client config doesn't have explicit <code>Insecure Registry</code> config for <code>192.168.x.x</code>.  You can check with:</p>
<pre><code>$ docker info | grep -i -A5 'Insecure Registries'
 Insecure Registries:
  10.96.0.0/12
  127.0.0.0/8
  192.168.64.0/24  &lt;== should have something like this
</code></pre>
<p>If not you can configure your <code>192.168.0.0/24</code> as an <a href="https://docs.docker.com/registry/insecure/" rel="nofollow noreferrer">insecure registry</a> in the <code>daemon.json</code> config:</p>
<pre><code>{
  &quot;insecure-registries&quot; : [&quot;10.96.0.0/12&quot;, &quot;127.0.0.0/8&quot;, &quot;192.168.64.0/24&quot; ]
}
</code></pre>
