Description of problem:
The undercloud installation process uploads unnecessary Docker images to the local registry.
[stack@undercloud-0 ~]$ for images in $(docker images | awk {'print $'1}); do docker ps | grep -q $images ; if [[ $? -ne 0 ]]; then echo $images; fi ;done
REPOSITORY
192.168.24.1:8787/rhosp14/openstack-cinder-api
192.168.24.1:8787/rhosp14/openstack-ceilometer-central
192.168.24.1:8787/rhosp14/openstack-cinder-volume
192.168.24.1:8787/rhosp14/openstack-aodh-evaluator
192.168.24.1:8787/rhosp14/openstack-aodh-listener
192.168.24.1:8787/rhosp14/openstack-ceilometer-notification
192.168.24.1:8787/rhosp14/openstack-barbican-keystone-listener
192.168.24.1:8787/rhosp14/openstack-aodh-api
192.168.24.1:8787/rhosp14/openstack-barbican-worker
192.168.24.1:8787/rhosp14/openstack-cinder-scheduler
192.168.24.1:8787/rhosp14/openstack-barbican-api
192.168.24.1:8787/rhosp14/openstack-gnocchi-metricd
192.168.24.1:8787/rhosp14/openstack-gnocchi-statsd
192.168.24.1:8787/rhosp14/openstack-gnocchi-api
192.168.24.1:8787/rhosp14/openstack-ceilometer-ipmi
192.168.24.1:8787/rhosp14/openstack-panko-api
192.168.24.1:8787/rhosp14/openstack-aodh-notifier
192.168.24.1:8787/rhosp14/openstack-tempest
Version-Release number of selected component (if applicable):
[stack@undercloud-0 ~]$ rpm -qa | grep tripleoclient
python-tripleoclient-10.4.1-0.20180803113705.1e3bb6e.el7ost.noarch
python-tripleoclient-heat-installer-10.4.1-0.20180803113705.1e3bb6e.el7ost.noarch
openstack-tripleo-heat-templates-9.0.0-0.20180804083746.el7ost.noarch
How reproducible:
Steps to Reproduce:
1. [stack@undercloud-0 ~]$ cat containers-prepare-parameter.yaml
# Generated with the following on 2018-09-04T19:43:05.478962
#
# openstack tripleo container image prepare default --output-env-file /home/stack/containers-prepare-parameter.yaml --local-push-destination
#
parameter_defaults:
ContainerImagePrepare:
- push_destination: 192.168.24.1:8787
set:
ceph_image: rhceph
ceph_namespace: $url:8888
ceph_tag: 3-11
name_prefix: openstack-
name_suffix: ''
namespace: $url/rhosp14
neutron_driver: null
openshift_base_image: ose
openshift_cockpit_image: registry-console
openshift_cockpit_namespace: registry.access.redhat.com/openshift3
openshift_cockpit_tag: v3.9
openshift_etcd_image: etcd
openshift_etcd_namespace: registry.access.redhat.com/rhel7
openshift_etcd_tag: 2018-08-23.1
openshift_namespace: registry.access.redhat.com/openshift3
openshift_tag: v3.9
tag: 2018-08-23.1
2.[stack@undercloud-0 ~]$ cat undercloud.conf
[DEFAULT]
# Network interface on the Undercloud that will be handling the PXE
# boots and DHCP for Overcloud instances. (string value)
local_interface = eth0
local_ip = 192.168.24.1/24
undercloud_public_host = 192.168.24.2
undercloud_admin_host = 192.168.24.3
undercloud_ntp_servers=$url
container_images_file=/home/stack/containers-prepare-parameter.yaml
docker_insecure_registries=$url
undercloud_service_certificate = /etc/pki/instack-certs/undercloud.pem
[ctlplane-subnet]
local_subnet = ctlplane-subnet
cidr = 192.168.24.0/24
dhcp_start = 192.168.24.5
dhcp_end = 192.168.24.24
gateway = 192.168.24.1
inspection_iprange = 192.168.24.100,192.168.24.120
masquerade = true
3. openstack undercloud install
Actual results:
The local docker registry uploads images which are not actually in use by the started containers:
[stack@undercloud-0 ~]$ for images in $(docker images | awk {'print $'1}); do docker ps | grep -q $images ; if [[ $? -ne 0 ]]; then echo $images $(docker images | grep $images | awk {'print $7$8'}); fi ;done
REPOSITORY
192.168.24.1:8787/rhosp14/openstack-cinder-api 1.02GB
192.168.24.1:8787/rhosp14/openstack-ceilometer-central 734MB
192.168.24.1:8787/rhosp14/openstack-cinder-volume 1.05GB
192.168.24.1:8787/rhosp14/openstack-aodh-evaluator 718MB
192.168.24.1:8787/rhosp14/openstack-aodh-listener 718MB
192.168.24.1:8787/rhosp14/openstack-ceilometer-notification 689MB
192.168.24.1:8787/rhosp14/openstack-barbican-keystone-listener 680MB
192.168.24.1:8787/rhosp14/openstack-aodh-api 718MB
192.168.24.1:8787/rhosp14/openstack-barbican-worker 680MB
192.168.24.1:8787/rhosp14/openstack-cinder-scheduler 931MB
192.168.24.1:8787/rhosp14/openstack-barbican-api 719MB
192.168.24.1:8787/rhosp14/openstack-gnocchi-metricd 1.06GB
192.168.24.1:8787/rhosp14/openstack-gnocchi-statsd 1.06GB
192.168.24.1:8787/rhosp14/openstack-gnocchi-api 1.06GB
192.168.24.1:8787/rhosp14/openstack-ceilometer-ipmi 735MB
192.168.24.1:8787/rhosp14/openstack-panko-api 729MB
192.168.24.1:8787/rhosp14/openstack-aodh-notifier 718MB
192.168.24.1:8787/rhosp14/openstack-tempest 787MB
Expected results:
Only images that are actually in use get uploaded to the local registry.
Additional info:
I think we could save some good time if we could avoid pulling not needed images from the initial remote registry source.
I'm not sure they are unnecessary as they could be used if a person enables the configs. These are technically services that can be enabled on the undercloud so I'm not sure this is any worse than what we used to do on the overcloud images by pre-installing all of the rpms. They likely share a bunch of common layers so I'm not sure the actual size is an issue either