<p>I am trying to setup a private docker registry to work with Kubernetes. I've setup the registry and the master-server thats running the Kubernetes cluster can pull images from the registry without a problem. Also, I've followed the docs of Kubernetes that explain how to connect to a private docker registry (see <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/</a>).</p>

<p>However, when I try to pull images from the docker registry through Kubernetes I get the following error:</p>

<pre><code>Failed to pull image "xxx.xxx.xxx.xxx:5000/helloworld:latest": rpc error: code = Unknown desc = Error response from daemon: Get https://xxx.xxx.xxx.xxx:5000/v1/_ping: x509: certificate signed by unknown authority
</code></pre>

<p>What I noticed is that the link that ends with v1/_ping is incorrect, it should be v2/_ping.</p>

<p>I ran the following command to generate my regcred: </p>

<pre><code>kubectl create secret docker-registry regcred --docker-server="https://xxx.xxx.xxx.xxx:5000/v2/" --docker-username=xxxxx --docker-password=xxxxxx --docker-email=xxxx@xxx.xx
</code></pre>

<p>I also googled a bit and found this: 
<a href="https://github.com/kubernetes/kubernetes/issues/20786" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/20786</a></p>

<p>These suggestions, unfortunately, it didn't help, but they do indicate that more people face the same issue.</p>

<p>Does someone know how to correctly setup a docker registry v2 with Kubernetes?</p>

<p>Thanks</p>

ARR
<p>Solved this issue, the master-server by default doesn't launch your deployments. So I needed to do the following at my slave servers:</p>

<ol>
<li>Add the certificate to /etc/docker/certs.d/my-registry-domain.com[:port]/ca.crt</li>
<li>Do docker login my-registry-domain.com[:port]</li>
<li>Add the docker registry secret to Kubernetes (see <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/</a>) --docker-server=docker-registry-domain.com/v2/ or v1 depending on what you run</li>
<li>Now it will successfully pull images from the docker registry.</li>
</ol>

<p>Hope it will help someone.</p>
