Bug 1369670 - The docker registry configured manually in docker config was overwritten by openshift-ansible during upgrade
Summary: The docker registry configured manually in docker config was overwritten by o...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cluster Version Operator
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Jason DeTiberus
QA Contact: Anping Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-24 06:24 UTC by liujia
Modified: 2016-09-08 01:24 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-24 12:53:49 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description liujia 2016-08-24 06:24:04 UTC
Description of problem:
The test registry was deleted during upgrade, i add an registry in docker config for ose3.3 image, but it will be set to default registry only(registry.access.redhat.com) during the upgrading, then result that upgrade fail because no v3.3.x image could be found in default registry.access.redhat.com.   

Version-Release number of selected component (if applicable):
atomic-openshift-utils-3.3.13-1.git.0.7435ce7.el7.noarch

How reproducible:
always

Steps to Reproduce:
1.install ose-3.2 in AH726.
2.update installer to 3.3. 
3.add an registry to /etc/sysconfig/docker

ADD_REGISTRY='--add-registry qa.test.registry.redhat.com --add-registry registry.access.redhat.com'
INSECURE_REGISTRY='--insecure-registry qa.test.registry.redhat.com'
4.specify openshift_image_tag in inventory file.
...
[OSEv3:vars]
ansible_ssh_user=cloud-user
ansible_become=yes
deployment_type=openshift-enterprise
openshift_image_tag=v3.3.0.22

...
5.ansible-playbook -i hosts /usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/upgrades/v3_3/upgrade.yml

Actual results:
it upgraded fail,i checked the docker config file and found that the add_reigstry which i configured in step 3 has been overwrited.

ADD_REGISTRY='--add-registry registry.access.redhat.com'


Expected results:
The existing docker config should be merged with the defined parameters in inventory hosts file. It should not overwrite the registry  directly which be configured by users.

Additional info:

Comment 1 Brenton Leanhardt 2016-08-24 12:26:40 UTC
If using atomic-openshift-installer I think you will have to set the OO_INSTALL_ADDITIONAL_REGISTRIES and OO_INSTALL_INSECURE_REGISTRIES environment variables.

If using ansible directly you can set the following in your inventory:

openshift_docker_additional_registries
openshift_docker_insecure_registries

Comment 2 Devan Goodwin 2016-08-24 12:35:36 UTC
Agreed, upgrade uses the docker role which has to generate the registry lines in /etc/sysconfig/docker.

If you're using an inventory and ansible directly (like your steps above) you can configure these with:

openshift_docker_additional_registries=brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888                                                                                                  
openshift_docker_insecure_registries=brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888      

If you're using the quick installer, Brenton's env variables method should still work and is likely the best option. You could also set the above vars in the deployment of a quick installer config file but that would require generating a quick installer config, then modifying it, and re-running, so the env var method Brenton suggests is probably best.

Comment 3 liujia 2016-09-08 01:24:03 UTC
Many thx. I've got your meaning. It is indeed not a bug but a misunderstanding about the difference between quick installer and ansible install.


Note You need to log in before you can comment on or make changes to this bug.