Rancher agent behind proxy


My test setup runs behind a proxy, so I use a command like this to add a host to my rancher setup:

docker run -d --privileged -e "http_proxy=proxy.host:8888" -e "https_proxy=proxy.host:8888" -e "NO_PROXY=" -v /var/run/docker.sock:/var/run/docker.sock rancher/agent:v0.7.11 http://rancher.server.host:8000/v1/scripts/022e74084.....0e4147e82e16d

Which works fine, except that all containers on that host get a Host IP pointing at the ip of the proxy.host machine, rather than the agent machine. I need the proxy for the agent to be able to download content from the internet, but apart from that, I don’t want it to use the proxy…

@kaos -e NO_PROXY should be set to your loopback IP and the domain/IP over which the hosts connect back to rancher. In other words, it should be set to and the host that is in the url at the end of your docker run command.

In your example, it should be set as:
-e NO_PROXY=',rancher.server.host'

Hope this helps. Let us know if it doesn’t.

1 Like

Thank you @cjellick, it was the missing piece of information I needed.

Now, I still have some issues with ports, but that is for another topic (and for me to do some more research/testing first).