Bug 1317975

Summary: Proxy variables for Containerized Nodes and Masters for using oc commands.
Product: OpenShift Container Platform Reporter: Eric Rich <erich>
Component: InstallerAssignee: Scott Dodson <sdodson>
Status: CLOSED ERRATA QA Contact: Gan Huang <ghuang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: aos-bugs, bleanhar, gpei, jokerman, mmccomas, rhowe
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openshift-ansible-3.0.60-1.git.0.3dbcb72.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 16:38:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Eric Rich 2016-03-15 16:23:49 UTC
Description of problem:

The proxy variables are not getting set for containerized Nodes and Masters and master services. Variable are inside the docker image but not used by openshift 

Version-Release number of selected component (if applicable):
3.1.1.6

How reproducible:
100%

Steps to reproduce: 
1. The platform behind proxy all on atomic
2. Run $ oc start-build cakephp-example

Result: 
Error from server: imageStreamTag "php:5.6" not found

when oc get is -n openshift

Additional info:


$ systemctl show atomic-openshift-master-api.service  | grep -i environmentfile
EnvironmentFile=/etc/sysconfig/atomic-openshift-master-api (ignore_errors=no)


$ cat /etc/systemd/system/atomic-openshift-master-api.service 

ExecStart=/usr/bin/docker run --rm --privileged --net=host --name atomic-openshift-master-api -v /var/lib/origin:/var/lib/origin -v /var/run/docker.sock:/var/run/docker.sock -v /etc/origin:/etc/origin openshift3/ose start master api --config=${CONFIG_FILE} $OPTIONS


Systemd services created only accept  $OPTIONS 

In order for Proxy variables to get set for the node.controller,or api workaround using openshift-master-api as an example. 

ExecStart=/usr/bin/docker run --rm --privileged --net=host --name atomic-openshift-master-api -v /var/lib/origin:/var/lib/origin -v /var/run/docker.sock:/var/run/docker.sock -v /etc/origin:/etc/origin openshift3/ose start master api --config=${CONFIG_FILE} $OPTIONS  -e HTTP_PROXY=${HTTP_PROXY} -e HTTPS_PROXY=${HTTPS_PROXY}  -e NO_PROXY=${NO_PROXY}

Comment 2 Scott Dodson 2016-03-16 15:55:22 UTC
Proposed fix is to pass in environment file via --env-file flag to docker run
https://github.com/openshift/openshift-ansible/pull/1624

To merge this into your installer to test :
git pull https://github.com/sdodson/openshift-ansible bz1317975

Comment 4 Gan Huang 2016-03-18 11:10:30 UTC
Verified with openshift-ansible-3.0.61-1.git.0.8150c45.el7.noarch

Test env:container + RHEL72 + 1 master + 1 node
Config http proxy, https proxy, no_proxy after installation.
Check master and node container:
[root@10 ~]# ps -ef |grep docker |grep master
root     19984     1  0 05:57 ?        00:00:00 /usr/bin/docker run --rm --privileged --net=host --name atomic-openshift-master --env-file=/etc/sysconfig/atomic-openshift-master -v /var/lib/origin:/var/lib/origin -v /var/run/docker.sock:/var/run/docker.sock -v /etc/origin:/etc/origin openshift3/ose start master --config=/etc/origin/master/master-config.yaml --loglevel=5

Sti build success.
Move it to verified.

Comment 6 errata-xmlrpc 2016-05-12 16:38:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1065