Fix undercloud containers images prepare

Images for containerized underclouds can be parametrized differently
as for overcloud deployments. For example, undercloud may fetch images
from a promotion pipeline, while overcloud may consume those from the
local registry hosted undercloud.

Align the containerized undercloud case with the recent changes docker registry
host, namespace and tag defaults. Consumed these from the common defaults, yet
allowing to diverge.

Fix conditions for undercloud-deploy to always prepare undercloud images for
containerized underclouds. If built locally with kolla, the undercloud_docker_*
parameters should point to a local registry. If fetched from remote registry,
the same logic applies. Altering `undercloud_docker_*` allows to cover
such cases.

Add the missing `undercloud_docker_registry_tag` parameter. Allow omitting
`undercloud_docker_registry_port`, when a registry host value does not require
a port, like 'docker.io' host.

Closes-bug: #1733800

Change-Id: Ic3d448c8215f44a957711e666a34e78482d8100d
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2017-11-22 09:35:00 +01:00
parent a72d3602cd
commit d0f1b1e241
4 changed files with 33 additions and 26 deletions

View File

@ -0,0 +1,15 @@
---
fixes:
- |
Containerized underclouds are allowed to have a custom
`undercloud_docker_registry_tag`. `undercloud_docker_registry_port`
may be omitted, if `undercloud_docker_registry_host` does not
expect a custom port, like 'docker.io'.
The docker registry host, port and tag for containerized undercloud
services default to the values provided for overcloud deployments.
You may want to alter it, if building images locally with Kolla, or
fetching from remote registries not fitting overcloud deployment cases.
As overcloud deployments may consume images form the undercloud local
registry, it is possible to have `undercloud_docker_*` and
`docker_*` params diverged for containerized underclouds vs overclouds.

View File

@ -69,14 +69,17 @@ your hacking setup. By defaults it updates nothing, which is backwards compatibl
`cloud-names.yaml` template used by the `overcloud-deploy` role.
- `tripleo_ui_secure_access`: Defaults to false due to the self signed certificate and
usability issues. See the tripleo-quickstart documentation `accessing the undercloud` for details.
- `undercloud_docker_registry_host`: <'null'> -- configures the custom registry host for
containerized undercloud services.
- `undercloud_docker_registry_port`: <'8787'> -- the container images registry port for the
custom `undercloud_docker_registry_host`, if defined.
- `undercloud_docker_registry_namespace`: <`docker_registry_namespace`> -- the
container images namespace to be used with the custom `undercloud_docker_registry_host`,
if defined. Defaults to the overcloud `docker_registry_namespace` variable, which in
turn defaults to 'tripleoupstream'.
- `undercloud_docker_registry_host`: <`docker_registry_host`> -- registry host/port
for containerized undercloud services. Defaults to the value provided for overcloud.
You may want to diverge it, if building locally, or fetching from remote registries
not fitting the overcloud deployment needs.
- `undercloud_docker_registry_port`: <null> -- an optional port for
`undercloud_docker_registry_host`.
- `undercloud_docker_registry_namespace`: <`docker_registry_namespace`> -- namespace of
docker images used for undercloud deployment. Defaults to the value provided for overcloud.
- `undercloud_docker_image_tag`: <`docker_image_tag`> -- tag of docker images used for
undercloud deployment. Defaults to the value provided for overcloud. Defaults to the
value provided for overcloud.
Role Network Variables
----------------------

View File

@ -8,8 +8,9 @@ network_environment_file: network-environment.yaml.j2
# default undercloud install method
# containerized_undercloud is an EXPERIMENTAL FEATURE
containerized_undercloud: false
undercloud_docker_registry_namespace: "{{ docker_registry_namespace|default('tripleoupstream') }}"
undercloud_docker_registry_port: 8787
undercloud_docker_registry_host: "{{ docker_registry_host }}"
undercloud_docker_registry_namespace: "{{ docker_registry_namespace }}"
undercloud_docker_image_tag: "{{ docker_image_tag }}"
undercloud_install_script: undercloud-install.sh.j2
# defines a custom undercloud roles file should be used with

View File

@ -89,7 +89,7 @@ sudo systemctl start openvswitch
{% if get_build_command is defined: %}
BUILD_ID={{ get_build_command }}
{% else %}
BUILD_ID={{ docker_image_tag }}
BUILD_ID={{ undercloud_docker_image_tag }}
{% endif %}
# Copy installed/cloned modules and make a symlink
@ -99,28 +99,16 @@ sudo ln -f -s /usr/share/openstack-puppet/modules/* /etc/puppet/modules/
## * Configure the undercloud containers default parameters
## ::
{% if undercloud_docker_registry_host is defined %}
{% if containerized_undercloud|bool %}
openstack overcloud container image prepare \
--env-file {{ working_dir }}/undercloud-containers-default-parameters.yaml \
{% if containerized_undercloud|bool %}
-e {{overcloud_templates_path}}/environments/services-docker/ironic.yaml \
-e {{overcloud_templates_path}}/environments/services-docker/mistral.yaml \
-e {{overcloud_templates_path}}/environments/services-docker/zaqar.yaml \
-e {{overcloud_templates_path}}/environments/docker.yaml \
{% endif %}
-r {{undercloud_roles_data}} \
{% else %}
openstack overcloud container image prepare \
{% if containerized_undercloud|bool %}
-e {{overcloud_templates_path}}/environments/services-docker/ironic.yaml \
-e {{overcloud_templates_path}}/environments/services-docker/mistral.yaml \
-e {{overcloud_templates_path}}/environments/services-docker/zaqar.yaml \
-e {{overcloud_templates_path}}/environments/docker.yaml \
{% endif %}
-r {{undercloud_roles_data}} \
--namespace {{ docker_registry_host }}/{{ docker_registry_namespace }} \
--tag $BUILD_ID \
--env-file {{ working_dir }}/undercloud-containers-default-parameters.yaml
--namespace {{ undercloud_docker_registry_host }}{% if undercloud_docker_registry_port is defined %}:{{ undercloud_docker_registry_port }}{% endif%}/{{ undercloud_docker_registry_namespace }} \
--tag $BUILD_ID
{% endif %}
echo "============================="