<p>I am trying to deploy an docker image from an insecure Repository using Kubernetes.
I have made couple of configuration settings in order to declare the repository as insecure and could also verify that the Repository is made Insecure.</p>

<p>Still while trying to deploy this sample application from the Kubernetes via </p>

<p>Dashboard / deployment.yaml / secret pod creation from all the 3 ways while trying to deploy the docker image from the insecure private registry i am seeing the below error . Request to provide some help in resolving the same.</p>

<pre><code> Events:
  Type     Reason     Age                  From                  Message
  ----     ------     ----                 ----                  -------
  Normal   Scheduled  41m                  default-scheduler     Successfully assigned registry/private-insecure-reg to kube-node-2
  Warning  Failed     40m (x2 over 40m)    kubelet, kube-node-2  Failed to pull image "x.x.x.x:5000/x-xxx": rpc error: code = Unknown desc = Error response from daemon: manifest for x.x.x.x:5000/x-xxx:latest not found
  Normal   BackOff    39m (x6 over 41m)    kubelet, kube-node-2  Back-off pulling image "127.0.0.1:5000/my-ubuntu"
  Normal   Pulling    39m (x4 over 41m)    kubelet, kube-node-2  pulling image "127.0.0.1:5000/my-ubuntu"
  Warning  Failed     39m (x2 over 41m)    kubelet, kube-node-2  Failed to pull image "x.x.x.x:5000/x-xxx": rpc error: code = Unknown desc = Error response from daemon: received unexpected HTTP status: 502 Bad Gateway
  Warning  Failed     39m (x4 over 41m)    kubelet, kube-node-2  Error: ErrImagePull
  Warning  Failed     52s (x174 over 41m)  kubelet, kube-node-2  Error: ImagePullBackOff
</code></pre>

<p>1) You need to configure docker service to use insecure registry by editing the file <code>/etc/default/docker</code> and update DOCKER_OPTS
e.g</p>

<pre><code>DOCKER_OPTS='--insecure-registry 127.0.0.1:5000'
</code></pre>

<p>2)restart docker</p>

<pre><code>sudo systemctl restart docker
</code></pre>
