kubernetes can't pull image from private docker registry

5/28/2019

to reproduce this case, i follow those tutorials first:

DOCKER - part

  1. part 1
  2. part 2
  3. part 3
  4. part 4

( ... All those parts was done on a ubuntu 18 virtual machine ... )

After those tutorials, this is the result:

first-part.png

Here you can see all the step in order to make it works on my local machine (mac os - Mojave)

KUBERNETES - part

I follow this tutorial:

  1. part 1

And you will see the error on the next image:

second-part.png

All those steps are don on my local machine (mac os - Mojave)

I don't know what is the problem. I don't know how to solve this

Can somebody help me with this, please?

I really want to understand this

Really thanks

-- Julio
docker
docker-machine
kubectl
kubernetes
minikube

2 Answers

7/3/2019

I think that issue is caused because your did not add your dockerserver as secure registry.

You should add your registry to daemon.json file.
You have to create or modify /etc/docker/daemon.json on the machine.

$ sudo vi /etc/docker/daemon.json (you can use nano or other text editor) Inside the file you have to add your repository. It should looks like

{
  "insecure-registries" : ["mydockerserver.com:5000"]
}

After this change you must restart docker daemon using

$ sudo service docker restart

Also in your yaml you should use:

...
  image: mydockerserver.com:5000/test-julie-image:latest
...

Please let me know if that helped.

-- PjoterS
Source: StackOverflow

5/28/2019

You want to pull it from local repo which is not https, add configuration to allow pull from insecure repository. find docker.conf file which for me is in this path /etc/systemd/system/docker.service.d/docker.conf and add below line

[Service]
ExecStart=/usr/bin/dockerd -H fd:// --insecure-egistry=<repo-address>:<port>
-- Siyavash vaez afshar
Source: StackOverflow