Proxy variables not set in alpine VM /etc/environment
See original GitHub issueRancher Desktop Version
1.0.0-beta.1
Rancher Desktop K8s Version
1.23.1
What operating system are you using?
macOS
Operating System / Build Version
Big Sur 11.6
What CPU architecture are you using?
x64
Windows User Only
No response
Actual Behavior
Proxy environment variables are not set in alpine VM /etc/environment. When trying to run/pull images, the image cannot be pulled from a repository due to proxy issues.
This has been fixed in Lima, at least for Lima’s default Ubuntu VM.
In my environment, my proxy variables are set in .bashrc, pointing to a proxy machine on the local network. System proxies “System Preferences -> Network -> Wifi (or other active interface) -> Advanced -> Proxies” are set via my organizations automatic proxy configuration script.
Steps to Reproduce
On a network which requires use of a proxy:
- Install Rancher Desktop 1.0.0-beta1 with ‘containerd’ as runtime.
- nerdtcl run --rm hello-world
Result
Fetching remote images times out, due to proxy.
Expected Behavior
Proxy variables should be set in the Alpine VM in /etc/environment. This allows images to be fetched.
WORK AROUND: Start Rancher Desktop, wait for VM to be up an running, then execute this command:
set | grep -iE '^[a-z]*_proxy=' | ssh \
-p $(awk '/localPort/ {print $2}' < ~/Library/Application\ Support/rancher-desktop/lima/0/lima.yaml) \
-i ~/Library/Application\ Support/rancher-desktop/lima/_config/user \
localhost 'sudo bash -c "cat >> /etc/environment; /etc/init.d/k3s restart"'
After running this command, remote images can be fetched as usual.
Additional Information
Consider adding a new “Proxies” tab, or section on “Troubleshooting” to manually enter proxy variables, Allow multiple variables to be set, one per line in the form of:
http_proxy=http://myproxy:1234
https_proxy=http://myproxy:1234
socks_proxy=http://myproxy:1234
etc.
“Apply” button should validate the proxy variables by: coercing the variable names as all lower case, using the regexp ‘^[a-z]*_proxy=’, duplicate the variable name as upper case, and copy the resulting lines to the VM /etc/environment. Proxy values should be accepted as is, which will allow for userid:password, if needed, e.g., “http_proxy=http://userid:pass@myproxy:1234”
The resulting lines in /etc/environment should look like:
http_proxy=http://myproxy:1234
HTTP_PROXY=http://proxy:1234
etc.
After setting /etc/environment, restart k3s by executing “/etc/environment /etc/init.d/k3s restart”’
These steps should also be applied when starting Rancher Desktop after a power up, or after “Factory Reset”.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
We will really like to have the GUI configuration:
As we work almost entirely remotely we often turn on and off the corporate VPN and have to enable/disable the proxy settings therefore a “Proxies” tab that remembers the settings even if the proxy is disabled would be most helpful.
As y’all consider adding a GUI to handle proxies, one thing that would be AMAZING is if y’all made it where we can provide a host that is only available when the proxy is available, and it configures the env variables when that host is reachable.
This would allow companies who have to use a proxy on the internal network, but not outside the network to work flawlessly without issue.