<p>So I have deployed a Kubernetes cluster and installed a private Docker registry. Here is my registry controller:</p>

<pre><code>---
  apiVersion: v1
  kind: ReplicationController
  metadata:
    name: registry-master
    labels:
      name: registry-master
  spec:
    replicas: 1
    selector:
      name: registry-master
    template:
      metadata:
        labels:
          name: registry-master
      spec:
        containers:
        - name: registry-master
          image: registry
          ports:
          - containerPort: 5000
          command: ["docker-registry"]
</code></pre>

<p>And the service:</p>

<pre><code>---
  apiVersion: v1
  kind: Service
  metadata:
    name: registry-master
    labels:
      name: registry-master
  spec:
    ports:
      # the port that this service should serve on
    - port: 5000
      targetPort: 5000
    selector:
      name: registry-master
</code></pre>

<p>Now I sshed to one of Kubernetes' nodes and built a Ruby app container:</p>

<pre><code>cd /tmp
git clone https://github.com/RichardKnop/sinatra-redis-blog.git
cd sinatra-redis-blog
docker build -t ruby-redis-app
</code></pre>

<p>When I try to tag it and push it to the registry:</p>

<pre><code>docker tag ruby-redis-app registry-master/ruby-redis-app
docker push 10.100.129.115:5000/registry-master/ruby-redis-app
</code></pre>

<p>I am getting this error:</p>

<pre><code>Error response from daemon: invalid registry endpoint https://10.100.129.115:5000/v0/: unable to ping registry endpoint https://10.100.129.115:5000/v0/
v2 ping attempt failed with error: Get https://10.100.129.115:5000/v2/: read tcp 10.100.129.115:5000: connection reset by peer
 v1 ping attempt failed with error: Get https://10.100.129.115:5000/v1/_ping: read tcp 10.100.129.115:5000: connection reset by peer. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 10.100.129.115:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/10.100.129.115:5000/ca.crt
</code></pre>

<p>Any idea how to solve it? I have been struggling with this for several hours.</p>

<p>Richard</p>

<p>if you're using HTTPS, you must have created a self-signed certificate (with your own CA authority) or you have a CA signed certificate.</p>

<p>If so, you need to install this CA cert on the machine you're calling FROM</p>

<p>put your CA cert in </p>

<pre><code>/etc/ssl/certs
</code></pre>

<p>and run </p>

<pre><code>update-ca-certificates
</code></pre>

<p>sometimes I have had to put it also in </p>

<pre><code>/usr/local/share/ca-certificates/
</code></pre>

<p>(in both cases your CA file EXTENSION should be <code>.pem</code>   </p>

<p>For Docker you may also need to put a file in </p>

<pre><code>/etc/docker/certs.d/&lt;--your-site-url---&gt;/ca.crt
</code></pre>

<p>and the file must be named <code>ca.crt</code>
(same file file as the .pem file but named ca.crt)</p>
