0

I have a docker registry(insecure) on my bastion/jumpbox.

We are running Kubernetes and I am trying to run a pod on a cluster that pulls an image from this registry. Since containerd is the container runtime, it throws an error ( ImagePullBackOff ):

Failed to pull image "1.1.1.2:4657/82d4bb7b89/dockerimages/abc:v2.3.0": http: server gave HTTP response to HTTPS client

It looks like with the ctr cli we could use --plain-http to pull the image, however,that wouldn't work for this scenario.

Is there any workaround to this error ? Also, we are using "kubectl create -f" to bring up the pod.

Dilip
  • 365
  • 1
  • 6
  • 18
  • 1
    Does this answer your question? [Adding insecure registry in containerd](https://stackoverflow.com/questions/65681045/adding-insecure-registry-in-containerd) – moonkotte Sep 09 '21 at 09:33
  • 1
    @WytrzymałyWiktor - We ended up applying SSL to the registry and made config.toml changes to get this to work – Dilip Oct 19 '21 at 18:38

1 Answers1

0

i also got the same error .i resloved it by following the steps given below

sudo rm -rf /etc/containerd/config.toml

sudo su -

mkdir -p /etc/containerd

containerd config default>/etc/containerd/config.toml

sudo systemctl restart containerd

sudo systemctl enable containerd

then after these steps open then file

sudo nano /etc/containerd/config.toml

find this line

[plugins."io.containerd.grpc.v1.cri".registry.configs]

add these 6 lines below that line

[plugins."io.containerd.grpc.v1.cri".registry.configs."registry-ip:5000"]

[plugins."io.containerd.grpc.v1.cri".registry.configs."registry-ip:5000".tls]

    ca_file = ""

    cert_file = "" 

    insecure_skip_verify = true 

    key_file = ""

then search this line [plugins."io.containerd.grpc.v1.cri".registry.mirrors]

and add the below lines below that line

     [plugins."io.containerd.grpc.v1.cri".registry.mirrors."registry-ip:5000"] 
      endpoint = ["http://reistry-ip:5000"] 

after this i restarted containerd

sudo systemctl restart containerd

its working fine after that

syed adeeb
  • 109
  • 10