I want to consult

Hi,

You didn’t indicate where you’re running the docker container with ‘registry’ in it, vs where your k8s cluster is running. Assuming docker registry is not running on the same node as the pod, the problem is that ‘localhost’ truly means “the current local host”.

In other words, if you’re running the registry on your laptop or a dev machine, “localhost” refers to that machine. When you deploy a pod, “localhost” in the pod likely refers to the node on which that pod is running.

Those two machines are not the same machine, therefore the image cannot be downloaded because there isn’t a registry running on the pod node at port 5000 (instead, that registry is back on your laptop or dev machine)

To resolve your issue you need to expose the docker registry using an ip address or preferably an IP name that the cluster node can reach. You also need to be sure that the docker registry port is open and accessible.

1 Like