Addictive Points When Using OpenShift Origin Under Proxy

Photo by Anne Nygård on Unsplash

Case

If we consider OpenShift Origin under Proxy, so make a note of the addictive points.

Prerequisites

  • oc version 1.3.1

Docker proxy settings

Create the /etc/systemd/system/docker.service.d/http-proxy.conf file with content below:

[Service]
Environment="HTTP_PROXY=http://proxy.com:3128" "HTTPS_PROXY=http://proxy.com:3128" "NO_PROXY=localhost,127.0.0.1,test.io"

You can see the description method in the Docker document, but one point to note. You cannot write an address in CIDR format in NO_PROXY . For example, 10.0.0.0/8 is no good. The IP address must individually list the domain name / host name.

OC cluster UP

We must specify environment variables with the -e option when running oc cluster up.

oc cluster up \
-e HTTP_PROXY=http://proxy.com:3128 \
-e HTTPS_PROXY=http://proxy.com:3128 \
-e '"NO_PROXY=localhost,test.io,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"'

If we do not set NO_PROXY, all REST API calls between OpenShift nodes will go to the Proxy, so you need to set it properly. One thing to keep in mind here is that if you pass a string with a comma in the -e option, it will be cut off (discarded) . Therefore, if you specify NO_PROXY, you must enclose the entire argument with’””’.

Check this issue for reference: