Open gi-dorio opened 1 year ago
I can reproduce this on Windows 10, without any VPN, proxy etc configured.
My steps to reproduce:
rancher-desktop
in that file with test-rancher-desktop
.KUBECONFIG
to %USERPROFILE%\.kube\config;%USERPROFILE%\.kube\test-config.yaml
.KUBECONFIG
to be updated in.kubectl
with kubectl config view
. It should load properly.@GiuseppeCSI you replaced $HOME
in your KUBECONFIG
with %USERPROFILE%
, or something like that, right? I couldn't reproduce the problem (and kubectl
didn't work) when I was using $HOME
.
@rak-phillip does this bring any potential causes to mind?
does this bring any potential causes to mind?
I suspect that the dashboard does not support one or more of these things:
KUBECONFIG
KUBECONFIG
setting (on Unix they would be replaced by the shell already);
as a path separator on Windows (Unix uses a :
)The whole KUBECONFIG
handling depends on the kube client library being used.
Following the repro steps produces this while starting steve
.\steve.exe
time="2023-03-10T14:26:02-08:00" level=fatal msg="error loading config file \"C:\\Users\\phillip\\.kube\\config;C:\\Users\\phillip\\.kube\\my-custom-kube-config.yaml\": open C:\\Users\\phillip\\.kube\\config;C:\\Users\\phillip\\.kube\\my-custom-kube-config.yaml: The filename, directory name, or volume label syntax is incorrect."
@adamkpickering I can confirm that I was using $HOME, but i guess it depends on what shell you are using. I use Powershell, so env variables are configured with $SOMETHING, while in cmd they are configured as %SOMETHING%. Don't quote me on this though, I've never had much experience with Windows shells, I switched to them recently.
@jandubois So, out of curiosity, how does the dashboard work in this regard? the normal kubectl cli has no problem accepting KUBECONFIG
with an env variable inside and the ;
, so what does the dashboard do differently? More than that, isn't it weird that the logs give back a proxy error?
Two components allow the dashboard feature to run in Rancher Desktop, Steve (the backend API) and a custom server that exists to serve the Dashboard UI and proxy requests. This implementation is similar to how everything behaves in a production deployment of Rancher Manager, but customized for Rancher Desktop.
The proxy errors might be misleading, but they reveal that the connection to Steve is refused. In this case, Steve never started because it doesn't handle the case of parsing multiple configs on Windows (possibly other environments as well, needs validation). Hopefully, this explains why we might see discrepancies between Dashboard and kubectl.
This is related to this issue, the root problem is how Rancher handles your kubeconfigs
https://github.com/rancher-sandbox/rancher-desktop/issues/3216
Actual Behavior
I've been using Rancher Desktop both for local development and to use kubectl to connect and operate on a remote cluster via cli. To do so, I've added my remote cluster kubeconfig.yaml in the .kube folder and set a global environment variable called
KUBECONFIG
to point both at the already present config and at my custom kubeconfig. Doing this operation breaks the Rancher Desktop dashboard for the local clusterSteps to Reproduce
KUBECONFIG=$HOME\.kube\config;$HOME\.kube\my-custom-kubeconfig.yaml
Result
When opening the dashboard for the local cluster, it gets stuck on infinite loading. The logs of the dashboard are as follows
Expected Behavior
The dashboard opens up and shows me the local cluster
Additional Information
I am behind a corporate proxy, but I don't think this should interfere. Plus, I get the same error by using another connection. I am still able to switch contexts and point both at the remote cluster and the local one via cli, the only thing that doesn't work is the dashboard.
If instead of adding the kubeconfig in the folder as a separate file I merge its contents with the config that's already there, obtaining something on the lines of
the dashboard works as expected and I can also operate on the remote cluster
Rancher Desktop Version
1.7.0
Rancher Desktop K8s Version
1.22.6
Which container engine are you using?
moby (docker cli)
What operating system are you using?
Windows
Operating System / Build Version
Windows 11 Enterprise, 10.0.22621, build 22621
What CPU architecture are you using?
x64
Linux only: what package format did you use to install Rancher Desktop?
None
Windows User Only
I am behind a corporate proxy when in the office and I use a VPN when I'm home. The problem persists even when I'm not in on of the two cases mentioned before (with standard home internet connection).