I have a CoreOS base Kubernetes deployment. I followed the instruction on GitHub to set up a private Docker registry: https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/registry/README.md
The registry came up and the registry proxy also came up:
$ kubectl get po --namespace=kube-system
NAME READY STATUS RESTARTS AGE
kube-dns-v9-hd0hz 4/4 Running 0 1d
kube-registry-proxy-10.1.52.113 1/1 Running 0 1d
kube-registry-proxy-10.1.52.114 1/1 Running 0 1d
kube-registry-proxy-10.1.52.117 1/1 Running 0 1d
kube-registry-proxy-10.1.52.118 1/1 Running 0 1d
kube-registry-v0-ib8vx 1/1 Running 0 1d
kubernetes-dashboard-17zfm 1/1 Running 0 1d
I was also able to push private image using the port-forward method (port forward to either the registry pod or the registry proxy pod.) But when I try to use the image, I get PullImageError:
kubectl run -i --tty ubuntu --image=localhost:5000/myfirstubuntu/ubuntu --restart=Never -- bash
And if I just create a new container with plain ubuntu and try to curl localhost:5000, I don't get the 404 error as shown in the instruction so looks like the pod on the same node is not talking to the registry-proxy as expected. What are the ways to further debug this?
run docker images
to make sure that the value of your image "REPOSITORY" is "localhost:5000/myfirstubuntu/ubuntu"
[root@centos7 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
localhost:5000/myfirstubuntu/ubuntu latest 05e197984182 18 hours ago 516.7 MB
Can try add configuration item in /etc/default/docker file DOCKER_OPTS="$DOCKER_OPTS --insecure-registry=localhost:5000" then service docker restart
Hope to provide some reference!