Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HELP] Local registry cannot be refered to by name outside of k3d cluster #866

Closed
nwithers-ecr opened this issue Nov 18, 2021 · 3 comments
Closed
Assignees
Labels
bug Something isn't working help Not necessarily a bug, but support is needed not a bug Luckily this is not a bug with k3d after all ¯\_(ツ)_/¯
Milestone

Comments

@nwithers-ecr
Copy link

nwithers-ecr commented Nov 18, 2021

What did you do

  • How was the cluster created?

    • k3d cluster create mycluster --registry-create mycluster-registry
  • What did you do afterwards?

docker ps -f name=mycluster-registry
docker pull alpine:latest
docker tag alpine:latest mycluster-registry:12345/testimage:local
docker push mycluster-registry:12345/testimage:local
> Get https://mycluster-registry:12345/v2/: dial tcp: lookup mycluster-registry on 8.8.4.4:53: no such host
docker tag alpine:latest localhost:12345/testimage:local
docker push localhost:12345/testimage:local
kubectl run --image localhost:12345/testimage:local testimage --command -- tail -f /dev/null
kubectl get pod
> testimage   0/1     ErrImagePull   0          2s
kubectl delete pod testimage
kubectl run --image mycluster-registry:12345/testimage:local testimage --command -- tail -f /dev/null
kubectl get pod
> testimage   1/1     Running   0          3s

What did you expect to happen

I expected to be able to tag the image with the registry name, but instead had to use localhost

Screenshots or terminal output

docker push mycluster-registry:12345/testimage:local
> Get https://mycluster-registry:12345/v2/: dial tcp: lookup mycluster-registry on 8.8.4.4:53: no such host

Which OS & Architecture

Linux DaringLion 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Which version of k3d

k3d version v5.1.0
k3s version v1.21.5-k3s2 (default)

Which version of docker

docker version

Client:
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.13.8
 Git commit:        20.10.7-0ubuntu5~20.04.2
 Built:             Mon Nov  1 00:34:17 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.8
  Git commit:       20.10.7-0ubuntu5~20.04.2
  Built:            Fri Oct 22 00:45:53 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.5.5-0ubuntu3~20.04.1
  GitCommit:
 runc:
  Version:          1.0.1-0ubuntu2~20.04.1
  GitCommit:
 docker-init:
  Version:          0.19.0
  GitCommit:

docker info

Client:
 Context:    default
 Debug Mode: false

Server:
 Containers: 15
  Running: 7
  Paused: 0
  Stopped: 8
 Images: 942
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 
 runc version: 
 init version: 
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-90-generic
 Operating System: Ubuntu 20.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 62.67GiB
 Name: DaringLion
 ID: N2MD:XACX:AT4A:ADPS:PHN6:6CUS:YR6H:VOWC:SN6M:YZT4:U6EW:X6AP
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: nwithers
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
@nwithers-ecr nwithers-ecr added the bug Something isn't working label Nov 18, 2021
@nwithers-ecr nwithers-ecr changed the title [BUG] Local registry not behaving as expected [BUG] Local registry cannot be refered to by name outside of k3d cluster Nov 18, 2021
@heesuk-ahn
Copy link

I have same issue, thanks your report :)

@iwilltry42 iwilltry42 added help Not necessarily a bug, but support is needed not a bug Luckily this is not a bug with k3d after all ¯\_(ツ)_/¯ labels Nov 29, 2021
@iwilltry42 iwilltry42 changed the title [BUG] Local registry cannot be refered to by name outside of k3d cluster [HELP] Local registry cannot be refered to by name outside of k3d cluster Nov 29, 2021
@iwilltry42 iwilltry42 added this to the v5.1.1 milestone Nov 29, 2021
@iwilltry42
Copy link
Member

iwilltry42 commented Nov 29, 2021

Hi @nwithers-ecr , thanks for opening this issue!
This is explained in the docs over here: https://k3d.io/v5.1.0/usage/registries/#preface-referencing-local-registries
If you have any other issue with it, feel free to reopen 👍

Note: the special Preface section was just added recently, as before this section was in an info box a bit further down on that page, so now it's more prominent 👍

@iwilltry42 iwilltry42 self-assigned this Nov 29, 2021
@nwithers-ecr
Copy link
Author

@iwilltry42 thanks for pointing that out. I knew I must have missed something. After updating /etc/hosts it worked correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help Not necessarily a bug, but support is needed not a bug Luckily this is not a bug with k3d after all ¯\_(ツ)_/¯
Projects
None yet
Development

No branches or pull requests

3 participants