-
Notifications
You must be signed in to change notification settings - Fork 283
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
Rancher doesn't work on VPN / Corporate Proxy #995
Comments
Answered by Andrew G on slack: "This is a known issue with Cisco anyconnect and is an issue with WSL itself" |
@ericpromislow I am currently experiencing the same issue (also on Windows) with a corporate proxy that isn't Cisco AnyConnect. My best guess is that the WSL distro that is launched by Rancher Desktop needs to be made aware of the proxy, but checking the configuration files that get installed in AppData I haven't found any section where I would be able to inject that information. |
Here's a link to Cisco's documentation on resolving issues with AnyConnect and local hypervisor traffic: |
Another link that may explain DNS issues with VPN: microsoft/WSL#1350 (comment) |
On Win10/WSL2, I am having a similar issue. I have several containers that hit resources over the internet. Some require VPN (Cisco AnyConnect) access. The names for ones that require VPN cannot be resolved. The host name looks like this:
If I go into WSL Ubuntu or rancher-desktop distros, the name can resolve. I created an Alpine container to test connectivity and it cannot resolve the name. If I add the name to the Alpine hosts file, it works, to the network connectivity is ok, just name resolution. These containers work fine when built and run from Docker Desktop, podman, or minikube. |
I have the same issue when connected to VPN rancher desktop doesn't connect to my organization image repo and also the it can't connect to public image repos. I tried the same with docker desktop on WSL2 connecting to VPN, it works fine. |
A hint which may help: The proxy variables must be made in the distro "rancher-desktop". Since it is an alpine distro without non-root user, I set the proxy variables in the file |
Hi @ckihm , I could not find any "rancher-desktop" distro in WSL after running the Rancher Desktop installer file "Rancher.Desktop.Setup.1.0.0-beta.1.exe". Is it hidden? Thanks in advance. |
Hi @louzadod, |
Hi @ckihm, thanks for the pointers, I've set the HTTP_PROXY / HTTPS_PROXY variables in |
Looking further into this, the alpine distro used as base for rancher-desktop uses openrc to manage the service calls, and openrc has no way of passing environment variables other than editing the init.d and/or conf.d files. However, RD replaces these files on each startup, so editing them is useless. There's actually one piece of config that could help in /etc/rc.conf, and that's rc_env_allow in which you can define a list of variables to be passed to all services, but it has no effect. It may be ignored or the variables are set only for the wsl-helper process, which is what's actually being called in the init.d/docker script. |
Setting I've mentioned this before in #1267 (comment). |
Thanks @mook-as, I was using /etc/profile to export the http_proxy variables. |
Similary, |
I don't know if it's something that changed from beta1 to 1.0.0, but I was able to make it work now. I'm still getting the kubernetes error "http: not supported, Expected https:" though |
I also encounter the same problem on Windows 10. Thanks @cidus for the idea. I am not sure if |
Hi Having another symptoma, linked with http-proxy variables in the w10 host. Is there a way for rancher-desktop to ignore the proxy configuration of the host to contact its underlying wsl2 instance? eg connection to dockerd etc? |
As previously mentioned, adding the following lines to
Note that you also need to have your DNS in
|
Thanks for that info! |
Hi all, I'd appreciate any help. I'm running Rancher Desktop 1.1.1 on Windows 10 Enterprise 20H2 19042.1526. I edited files /etc/rc.conf, /etc/environment, /etc/profile, /etc/resolv.conf, /etc/wsl.conf using:
I restarted distribution by switching container runtime in Rancher Desktop between containerd and dockerd. Then I confirmed:
When I look at environment, I don't see any of the variables:
I tried with and without export. I do see my changes persist after I restart distribution. But no variables in environment and Rancher Desktop continues to display:
I should see variables in environment, correct? Does some component not yet support format http://[username]:[password]@[hostname][:port]? There are no special chars in my username, password, hostname, or port. |
It seems neither the solution with rc.conf or setting the proxy env variables in the provisioning script is working in 1.2.1. My provisioning script that worked in previous releases.
|
We have implemented an experimental feature to address this issue, please take a look at here on how to enable it. Feel free to provide us with some feedback as we are planning to expose this feature as non-experimental in our upcoming release. |
I've installed version 1.3.0 on windows 10, haven't gotten rancher-desktop to work with my current vpn in previous versions and have set
Also kubernetes won't start anymore as soon as i am connected to vpn. |
@jcageman are you seeing the same results with I suspect all traffic is being routed through the security gateway and nothing is being resolved by the host-resolver itself and the VPN client might treat host-resolver traffic as DNS Hijacking. Are you able to verify that you have this configuration for split DNS enabled? |
Regarding the " |
I've got a reply from our IT department:
So for sure we are using split-dns and i think if i tick the box "route all traffic through gateway" it just means everything is routed through the VPN connection. I will also have an internal IP in this case, which is exactly the reason why i have it enabled, since many places within my company require that internal IP. |
The cause of the VPN communication failure is not the Rancher Desktop, but the WSL and the WinNAT on Hyper-V that the WSL uses. Reference: VPN に繋ぐと WSL2 や Hyper-V VM でネットワークに繋がらなくなる問題を解消する The above page also describes the solution, but we quote an excerpt here.
Using this method, you should be able to connect to proxies in the intranet from within the container. |
@advanceboy thanks for the update, we have a solution here, however, this is a temporary workaround. We are working on a more robust permanent solution. |
we have introduced an experimental #3810 in 1.8.1 that should fix your VPN issue. The feature will be fully baked in our next few upcoming releases. As I mentioned it is experimental and the downside is the port forwarding for all the publish ports has to be performed manually as mentioned here: #4096 (comment) |
You can now enable the new network using
This should allow Rancher Desktop to function correctly behind a VPN. I'm going to close this issue, feel free to re-open if this suggestion is not solving the issue. |
Rancher Desktop Version
0.6.1
Rancher Desktop K8s Version
1.21.6
What operating system are you using?
Windows
Operating System / Build Version
20H2
What CPU architecture are you using?
x64
Windows User Only
corporate vpn, we also have a required proxy when using that vpn. from what i can gather the rancher-desktop is not aware of the proxy at all.
Actual Behavior
when connected to a VPN the image pulling / dns detection capability of the rancher-desktop wsl stop working.
once off the VPN image pull can resolve on public repo.
Steps to Reproduce
Result
time="2021-11-24T15:05:11Z" level=info msg="trying next host" error="failed to do request: Head "https://dev.artifactory.internal.ca/v2/gasp/certificates/manifests/latest\": dial tcp: lookup dev.artifactory.internal.ca on 172.18.240.1:53: no such host" host=dev.artifactory.internal.ca
time="2021-11-24T15:05:11Z" level=fatal msg="failed to resolve reference "dev.artifactory.internal.ca/gasp/certificates:latest": failed to do request: Head "https://dev.artifactory.internal.ca/v2/gasp/certificates/manifests/latest\": dial tcp: lookup dev.artifactory.internal.ca on 172.18.240.1:53: no such host"
Expected Behavior
rancher to use the proxy to resolve it's pull mechanic.
being able to retrieve image once this is done.
Additional Information
No response
The text was updated successfully, but these errors were encountered: