modern-energy-9738
04/29/2025, 8:11 PMkubectl
running from a separate Docker container over to a cluster created by k3d.
For context, I’m using Rancher Desktop on a MacBook Pro, and run k3d cluster create <name> --no-lb
to bring up the cluster with one server container only.
The other container is run up with docker run --interactive --network <cluster network> --rm --tty --volume "$HOME/.kube:/root/.kube:ro" <image tag> /bin/bash
.
From a terminal on my machine outside of any containers, curl --insecure <https://0.0.0.0>:<random k3d port>
gives an expected 401 unauthorised JSON response from the cluster, but the same curl ...
from inside my separate Docker container gives curl: (7) Failed to connect to 0.0.0.0 port 65168 after 0 ms: Couldn't connect to server
. Same with `kubectl version`; from outside I see Server Version: v1.31.5+k3s1
but from inside the other container I see The connection to the server 0.0.0.0:65168 was refused - did you specify the right host or port?
.
I have my kubeconfig file mounted through into the container so the config is all there, but I guess I’m missing some more network plumbing somewhere? Do I need to update the 0.0.0.0
address that is set inside the kubeconfig?
Thanks in advance for any notes! 🙏wide-garage-9465
04/29/2025, 8:26 PMwide-garage-9465
04/29/2025, 8:44 PMmodern-energy-9738
04/30/2025, 6:20 AM