-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
PODMAN not able to tunnel thru Proxy in an Enterprise Proxy Environment #11941
Comments
@ashley-cui @baude PTAL |
I think you can pass the proxy variables if you set up a custom ignition file, though it would be nice if podman auto-detected proxy settings and passed them through. Some enterprise proxies also do SSL inspection, which requires loading a custom trusted CA into a user's workstation trust store. I believe tools commonly use the
|
@gclawes Can you point me to any readme that can help with the steps and syntax for creating custom ignition file? |
another option would be to create a CA bundle directly from the osx keychain passed into the machine. It's transparent for the end user and less management overhead maintaining multiple bundles. this is also the approach docker inevitably took. https://docs.docker.com/desktop/mac/#add-custom-ca-certificates-server-side |
@bcg62 Issue i am seeing is with connectivity. I could not find details on setting up Ignition file - can someone point me to details on setting up Ignition file ? |
I'm having the same issue, I am not able to use podman on my M1 which is behind a corporate proxy.
|
@ctml91 Looks like it is getting through Porxy in your case and SSL handshake is failing. Did you do anything specific to set HTTP_PROXY setting ? I have those in my ENV and also tried to mess with container.conf file to see if those are honored by PODMAN. None of attempts get past the connectivity issue. |
This is the standard error I get when proxy is not configured. It may look a bit different than your error, but that's probably just dependent on network/proxy setup. I haven't been able to get proxy to work with podman + qemu. Tried copying the ignition config from the default vm stored under
|
This is interesting... Watching in case anyone finds out how to resolve this. |
I think what you are saying is that Is happening on the server side not the client side. |
@rhatdan sorry about that. Made a critical typo. I've updated it in my original post. Pulling containers with podman using either podman functionality doesn't work through a proxy using just an argument. |
This is definitely a bug, and we have opened a discussion on how to fix it. |
Some thoughts on how podman can discover the proxy settings:
Also, PLEASE support no_proxy stuff. Most companies that use proxies need to access stuff that's on the internal network and outside the network, but only outside requires proxy. |
The way Docker engine handles this is obnoxious because it requires a GUI toggle and restarting the VM when you jump on / off a corporate network. If there were a way to have |
I'm having the same issue and have attempted several ways of modifying the proxy and cert files. Here the relevant portion of my ignition file. I'd be grateful for anyone who can spot an error.
|
We solved this in a corporate environment on MacOS that requires a secure proxy server to access all external resources. We use the podman managed machine via Requires: Podman 3.4.0 at a minimum on MacOS host and managed machine. Configure Proxy Support Globally for All Systemd Servicessudo mkdir /etc/systemd/system.conf.d Place in
Allow Interactive Login Sessions to VM to Use ProxyPlace in PROXY_URL=<your-proxy-URL>
export http_proxy="$PROXY_URL"
export https_proxy="$PROXY_URL"
export ftp_proxy="$PROXY_URL"
export no_proxy=".<set-of-host-domain-exclusion(s)>,localhost,127.0.0.1,0.0.0.0,::1"
export HTTP_PROXY="$PROXY_URL"
export HTTPS_PROXY="$PROXY_URL"
export FTP_PROXY="$PROXY_URL"
export NO_PROXY=".<set-of-host-domain-exclusion(s)>,localhost,127.0.0.1,0.0.0.0,::1" Configure Trusted Certificates
install -o root -g root -m 0644 *.pem *.crt /etc/pki/ca-trust/source/anchors
sudo update-ca-trust Restart Managed MachineUnfortunately in order to have the Systemd configuration for proxy configuration to take effect you will have to restart the podman managed machine from the host: podman machine stop
podman machine start Works on both Catalina and Big Sur. |
@cpolizzi Thanks a bunch. This worked like a charm. |
Is this still an issue then? |
Nope. Can be closed ? |
I don't know how feasible it is but it might be nice to have these managed through a set of flags, so one doesn't need to login the VM and update proxy variables as you switch networks (proxied and not)? Or would the preferred solution to be have two VM's spawned by podman, and have one dedicated for the proxied network and another for non proxied? |
I would have hoped for passed in parameters (or maybe some other initialization handling/scripting? kind of like a vagrant file? maybe other things are needed beyond proxy?)... Just for a larger dev team, having a set of instructions to configure it every time is... painful (new hires, proxy change, etc). Especially if you can be in a proxy env and non-proxy environment at different times. |
Ideally the
|
FWIW, CodeReady containers from RedHat handles this by having config options cover this.
If that's too much to implement, any chance the machine init could create a config file per machine that environment/arbitrary files could be added to ignition? |
Can you open a feature request issue about this? |
Opened: #12739 |
I'm having the same issue, I am not able to do a podman pull from behind a corporate proxy. Is the solution for this to set all these proxy environment settings and certificates manually in the Podman machine? |
That's what worked for me. I set the systemd default environment as above in this comment: #11941 (comment) Only difference (and it's a preference) is I use |
I'm assuming that @cpolizzi 's solution was to modify those files inside the podman VM, not the mac. (Since my Mac doesn't have that first directory, because systemd is not installed.) I note that by default my proxy env vars were already present in the virtual machine, but all in one line, which I'm guessing is fine.
|
In my use case, my proxy is actually CNTLM running on the host (which in turn forwards traffic to my corporate proxy.) I suspect the issue is that there's no path for traffic from the VM to the host? I tried swapping |
@mdavis-xyz Yes my solution is as follows for the proxy: https://cpolizzi.github.io/podman/podman-as-a-replacement-for-docker-desktop.html#_corporate_network_considerations. This covers both proxying and privately issued certificates. Note that the only real workable solution is to configure SystemD globally for the needed proxy environment variables. If Podman supported / honored SystemD drop in units then configuring SystemD globally would be unnecessary (I also provide an example of what that would look like). |
@mdavis-xyz By default the podman managed machine cannot make outbound connections from the VM to the host. However, here is how to do it: https://cpolizzi.github.io/podman/orchestrating-podman-vm-to-host-communication.html |
Yes those two instructions together worked for me. Thanks! |
/kind bug
Description
PODMAN running in local MacOS is not able to honor Proxy Env setting in a corporate proxy setting.
Steps to reproduce the issue:
brew install qemu
brew install podman
podman machine init
podman machine start
podman pull nginx:alpine
6
Describe the results you received:
Resolving "nginx" using unqualified-search registries (/etc/containers/registries.conf.d/999-podman-machine.conf)
Trying to pull docker.io/library/nginx:alpine...
Error: initializing source docker://nginx:alpine: pinging container registry registry-1.docker.io: Get "https://registry-1.docker.io/v2/": dial tcp 3.229.227.53:443: i/o timeout
Describe the results you expected:
I am expecting it to be able to pull the image from Docker Library. I am suspecting Image Pull is run at the local VM machine spin up as part of PODMAN machine, if so, how can we get the PROXY setting pushed to the VM. Are there any command for debug in VM ? I am new to PODMAN, sorry if i am asking some of the basic questions.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes. Does not information on local Podman execution.
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: