0

I have a Kubernetes cluster with a Master node and a worker node and i decided to create a private docker registry in order to push the images and distribute them to the worker nodes when it is needed.

I made the following steps:

  1. Created a docker-compose file :
version: '3.0'
    
    services:
    
      registry:
        container_name: docker-registry
        restart: always
        image: registry:2
        ports:
          - 5000:5000
        volumes:
          - docker-registry-data:/var/lib/registry
    
    volumes:
      docker-registry-data: {}
  1. I ran the docker-compose.yaml file and when i saw the docker-compose processes i had the following output:

docker-registry /entrypoint.sh /etc/docker ... Up 0.0.0.0:5000->5000/tcp,:::5000->5000/tcp

  1. Then i created a simple docker image and pushed it into my docker registry. When i check my images i can see it :
REPOSITORY                TAG        IMAGE ID       CREATED          SIZE
localhost:5000/myimage   v2         0c68aa61e008   18 minutes ago   124MB
  1. In /etc/docker/daemon.json of my worker node i entered : "insecure-registries": ["master_ip:5000"]

**In insecure-registries above i entered the ip of my master node because there i created the docker registry.

After this configuration i supposed that when i try to run a pod in my cluster by using an image which is located in my docker registry it should work. But the status of my created pod is ImagePullBackOff and when i see the logs of the pod i have the following output :

Failed to pull image "<master_ip>:5000/myimage:v2": rpc error: code = Unknown desc = failed to pull and unpack image "<master_ip>:5000/myimage:v2": failed to resolve reference "<master_ip>:5000/myimage:v2": failed to do request: Head https://<master_ip>:5000/v2/myimage/manifests/v1: http: server gave HTTP response to HTTPS client
Rodr
  • 31
  • 6
  • Is your kubernetes cluster using that specific docker engine to pull all images? Is your cluster even using docker for it's CRI? – BMitch Jun 02 '22 at 10:31
  • I think yes, but how can i check this to be sure? – Rodr Jun 02 '22 at 10:34
  • I checked my nodes of my cluster and finally they have as container run time "container d". Is this the reason that when i deploy a pod with an image that i created with Dockerfile loacaly the pod status is ErrImagePull? – Rodr Jun 02 '22 at 11:07

0 Answers0