https://rancher.com/ logo
#k3d
Title
p

polite-engineer-55788

08/25/2022, 8:32 AM
how can we use nodeip with k3d cluster, I mean trying to reach a service of the cluster from say another container of the same docker network ?
@wide-garage-9465 any tips?
b

big-librarian-12753

08/25/2022, 8:39 AM
did you try host.k3d.internal ?
p

polite-engineer-55788

08/25/2022, 8:39 AM
yeah but my container is not part of kube cluster
b

big-librarian-12753

08/25/2022, 8:39 AM
you may need to attach that container to docker network.
p

polite-engineer-55788

08/25/2022, 8:40 AM
I am also trying
host.docker.internal
with container and k3s on same network
b

big-librarian-12753

08/25/2022, 8:42 AM
• i usually run a docker registry and a k3d cluster alongside • if my k3d cluster name is
test
and registry is
registry.localhost
I'd simply run
docker network connect k3d-test registry.localhost
p

polite-engineer-55788

08/25/2022, 8:43 AM
thanks @big-librarian-12753 I am trying the same now
w

wide-garage-9465

08/25/2022, 2:09 PM
@polite-engineer-55788 you mean nodePort maybe? To reach a service inside the cluster from outside the cluster? Should work exactly like that, via <k3d-node-container-name>:<nodePort> or <k3d-node-container-ip>:<nodePort> 🤔 The other way around works just as well as @big-librarian-12753 showed already
p

polite-engineer-55788

08/25/2022, 2:29 PM
yeah that works @wide-garage-9465 , for better clarity i tried using
host.docker.internal:<nodePort>
so it works with any number of agents/server 😄
w

wide-garage-9465

08/25/2022, 2:46 PM
Yup if the ports are forwarded, that's convenient 👍
🙌🏽 1
12 Views