1

I am creating a registry:

k3d registry create registry.localhost --port 8087

a registry.yaml file:

mirrors:
  'localhost:8087':
    endpoint:
      - http://k3d-registry.localhost:8087

and a cluster:

k3d cluster create dev -p "8000:80@loadbalancer" --registry-use k3d-registry.localhost:8087 --registry-config registry.yaml

and am running the following to test it out:

docker pull nginx
docker tag nginx:latest localhost:8087/nginx:latest
docker push localhost:8087/nginx:latest

kubectl run nginx --image localhost:8087/nginx:latest

which produces the following output:

Using default tag: latest
latest: Pulling from library/nginx
Digest: sha256:943c25b4b66b332184d5ba6bb18234273551593016c0e0ae906bab111548239f
Status: Image is up to date for nginx:latest
docker.io/library/nginx:latest
The push refers to repository [localhost:8087/nginx]
a2e59a79fae0: Layer already exists 
4091cd312f19: Layer already exists 
9e7119c28877: Layer already exists 
2280b348f4d6: Layer already exists 
e74d0d8d2def: Layer already exists 
a12586ed027f: Layer already exists 
latest: digest: sha256:06aa2038b42f1502b59b3a862b1f5980d3478063028d8e968f0810b9b0502380 size: 1570
pod/nginx created

however, this consistently results in an error pulling the image:

...
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  kube-api-access-qfwbg:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason     Age   From               Message
  ----     ------     ----  ----               -------
  Normal   Scheduled  7s    default-scheduler  Successfully assigned default/nginx to k3d-dev-server-0
  Normal   Pulling    8s    kubelet            Pulling image "localhost:8087/nginx:latest"
  Warning  Failed     8s    kubelet            Failed to pull image "localhost:8087/nginx:latest": rpc error: code = Unknown desc = failed to pull and unpack image "localhost:8087/nginx:latest": failed to resolve reference "localhost:8087/nginx:latest": failed to do request: Head "http://k3d-registry.localhost:8087/v2/nginx/manifests/latest?ns=localhost%3A8087": dial tcp 172.22.0.4:8087: connect: connection refused
  Warning  Failed     8s    kubelet            Error: ErrImagePull
  Normal   BackOff    7s    kubelet            Back-off pulling image "localhost:8087/nginx:latest"
  Warning  Failed     7s    kubelet            Error: ImagePullBackOff

any idea what I'm missing here? based on the documentation here, I am expecting this to work. I've gone through every related issue I can find online with no luck, would really appreciate some help here.

mlz7
  • 2,067
  • 3
  • 27
  • 51

0 Answers0