user3162553
user3162553

Reputation: 2869

K3D (Kubernetes) Registry Fails with No Such Host

It appears the default K3D registry commands are broken.

k3d registry create test-registry.localhost --port 23456
k3d cluster create test-cluster --registry-use k3d-test-registry.localhost:23456
docker tag nginx:latest my-cluster.localhost:12347/mynginx:v0.1
docker push k3d-test-registry.localhost:23456/mynginx:v0.1

Fails with:

The push refers to repository [k3d-test-registry.localhost:23456/mynginx]
Get "https://k3d-test-registry.localhost:23456/v2/": dialing k3d-test-registry.localhost:23456 with direct connection: resolving host k3d-test-registry.localhost: lookup k3d-test-registry.localhost: no such host

The expected behavior is that the host is aliased to localhost:23456 and can handle the pushed image. A better experience if that can't happen is that there is an error when trying to create the registry or mapping the host.

System:

Upvotes: 4

Views: 856

Answers (1)

kspyy
kspyy

Reputation: 71

Just ran into this playing with k3d

On Mac: Sudo edit your /etc/hosts file and add this entry for the name of your registry cluster name:

127.0.0.1 k3d-test-registry

and save that file, then try to push to it again

Step 2 from: https://k3d.io/v5.1.0/usage/registries/#preface-referencing-local-registries

Upvotes: 1

Related Questions