This message was deleted.
# rancher-desktop
a
This message was deleted.
w
you would normally use kubectl to connect to the cluster, but devcontainer doesn't really utilize k8s and only needs dockerd to function?
a
I think, when working with RD and devcontainer, the idea is to use the RD cluster as a local dev cluster and the devcontainer as the development environment. Just using the devcontainer without the RD cluster is not very useful. Correct, kubectl should be used in the same way as using on the Windows host. To use a devcontainer may seem to be much. But with a devcontainer I can use consistent development environments. Until now I used devcontainer with an embedded k3d. But why not use the RD k3s?
w
got it you installed k3d inside your devcontainer. you should be able to install kubectl, grab your config, and then bounce through the host to the k8s instance running in parallel to the devcontainer
a
No, what I want is to use Rancher Desktop including the Kubernetes cluster, which is a k3s instance. (k3d is just an example how I use a devcontainer with kubernetes, but without Rancher Desktop) The article mentioned before regarding VS Code Remote Containers just describes a devcontainer without connectivity to the k3s instance of Rancher Desktop. But I think, that is the whole idea: To use a devcontainer in combination with the RD k3s instance. But I cannot establish a connection from the devcontainer to the RD k3s instance.
w
you would need to route through the host. how are you trying to access the RD VM and it's containers from your devcontainer? And this windows or mac?
a
This is RD on Windows Step 1 - follow RD How-to https://docs.rancherdesktop.io/how-to-guides/vs-code-remote-containers Step 2- establish connection to RD cluster I just thought if RD provides a how-to how to setup a vs code remote container (=devcontainer), it only makes sense with connection to the RD cluster.
w
so guessing you are going to run kubectl in the devcontainer to connect to the k3d on the other disrtro? Feels close to how RD can integrate with other WSL distros, but networking could get fun. I would say start w copying your .kube/config in from the host and see if the 127.0.0.1 loopback works. If not may take some trial and error to get the best IP since you will go out of your devcontainer in the WSL VM into the vswitch and then into the alpine dstro for RD running in the same WSL VM.