<p>I'm trying (for tests purpose) to expose to kubernetes a very simple image pong http:</p>

<pre><code>FROM golang:onbuild
EXPOSE 8000
</code></pre>

<p>I built the docker image: </p>

<pre><code>docker build -t pong .
</code></pre>

<p>I started a private registry (with certificates):</p>

<pre><code>docker run -d --restart=always --name registry -v `pwd`/certs:/certs -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key -p 443:443 registry:2.6.2
</code></pre>

<p>I created a secret: </p>

<pre><code>kubectl create secret docker-registry regsecret --docker-server=localhost --docker-username=johndoe --docker-password=johndoe --docker-email=johndoe@yopmail.com
</code></pre>

<p>I uploaded the image: </p>

<pre><code>docker tag 9c0bb659fea1 localhost/pong
docker push  localhost/pong
</code></pre>

<p>I had an insecure registry configuration </p>

<pre><code>{
  "storage-driver" : "aufs",
  "insecure-registries" : [
    "localhost"
  ],
  "debug" : true,
  "experimental" : true
}
</code></pre>

<p>So I tried to create my kubernetes pods with: </p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: pong
spec:
  containers:
    - name: pong
      image: localhost/pong:latest
      imagePullPolicy: Always
  imagePullSecrets:
    - name: regsecret
</code></pre>

<p>I'm on MacOS with docker Version 17.12.0-ce-mac49 (21995).</p>

<p>If I use <code>image: localhost/pong:latest</code> I got:</p>

<pre><code>waiting:
          message: 'rpc error: code = Unknown desc = Error response from daemon: error
            parsing HTTP 404 response body: invalid character ''d'' looking for beginning
            of value: "default backend - 404"'
          reason: ErrImagePull
</code></pre>

<p>I'm stuck on it since the beginning of the week, without success.</p>

<p>It was not a problem of registry configuration.
I forgot to mention that I used minikube.</p>

<p>For the flags to be taken into account, I had to delete the minikube configuration and recreate it</p>

<p><code>minikube delete</code></p>

<p><code>minikube start --insecure-registry="10.0.4.0/24"</code></p>
