Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 7. Customizing container images
Red Hat OpenStack Platform (RHOSP) services run in containers, therefore to deploy the RHOSP services you must obtain the container images. You can generate and customize the environment file that prepares the container images for your RHOSP deployment.
7.1. Preparing container images for director installation Copier lienLien copié sur presse-papiers!
Red Hat supports the following methods for managing container images for your overcloud:
-
Pulling container images from the Red Hat Container Catalog to the
image-serveregistry on the undercloud and then pulling the images from theimage-serveregistry. When you pull images to the undercloud first, you avoid multiple overcloud nodes simultaneously pulling container images over an external connection. - Pulling container images from your Satellite 6 server. You can pull these images directly from the Satellite because the network traffic is internal.
The undercloud installation requires an environment file to determine where to obtain container images and how to store them. You generate a default container image preparation file when preparing for director installation. You can customize the default container image preparation file.
7.1.1. Container image preparation parameters Copier lienLien copié sur presse-papiers!
The default file for preparing your containers (containers-prepare-parameter.yaml) contains the ContainerImagePrepare heat parameter. This parameter defines a list of strategies for preparing a set of images:
Each strategy accepts a set of sub-parameters that defines which images to use and what to do with the images. The following table contains information about the sub-parameters that you can use with each ContainerImagePrepare strategy:
| Parameter | Description |
|---|---|
|
| List of regular expressions to exclude image names from a strategy. |
|
|
List of regular expressions to include in a strategy. At least one image name must match an existing image. All |
|
|
String to append to the tag for the destination image. For example, if you pull an image with the tag 17.1.0-5.161 and set the |
|
| A dictionary of image labels that filter the images that you want to modify. If an image matches the labels defined, the director includes the image in the modification process. |
|
| String of ansible role names to run during upload but before pushing the image to the destination registry. |
|
|
Dictionary of variables to pass to |
|
| Defines the namespace of the registry that you want to push images to during the upload process.
If you set this parameter to
If the |
|
| The source registry from where to pull the original container images. |
|
|
A dictionary of |
|
|
Use the value of specified container image metadata labels to create a tag for every image and pull that tagged image. For example, if you set |
When you push images to the undercloud, use push_destination: true instead of push_destination: UNDERCLOUD_IP:PORT. The push_destination: true method provides a level of consistency across both IPv4 and IPv6 addresses.
The set parameter accepts a set of key: value definitions:
| Key | Description |
|---|---|
|
| The name of the Ceph Storage container image. |
|
| The namespace of the Ceph Storage container image. |
|
| The tag of the Ceph Storage container image. |
|
| The name, namespace, and tag of the Ceph Storage Alert Manager container image. |
|
| The name, namespace, and tag of the Ceph Storage Grafana container image. |
|
| The name, namespace, and tag of the Ceph Storage Node Exporter container image. |
|
| The name, namespace, and tag of the Ceph Storage Prometheus container image. |
|
| A prefix for each OpenStack service image. |
|
| A suffix for each OpenStack service image. |
|
| The namespace for each OpenStack service image. |
|
|
The driver to use to determine which OpenStack Networking (neutron) container to use. Use a null value to set to the standard |
|
|
Sets a specific tag for all images from the source. If not defined, director uses the Red Hat OpenStack Platform version number as the default value. This parameter takes precedence over the |
The container images use multi-stream tags based on the Red Hat OpenStack Platform version. This means that there is no longer a latest tag.
7.1.2. Guidelines for container image tagging Copier lienLien copié sur presse-papiers!
When you prepare image containers in your containers-prepare-parameter.yaml file, you use parameters to determine which container image director pulls when updating your environment, as described in Container image preparation parameters. The Red Hat Container Registry uses a specific version format to tag all Red Hat OpenStack Platform container images. This format follows the label metadata for each container, which is version-release:
- version
- Corresponds to a major and minor version of RHOSP. These versions act as streams that contain one or more releases.
- release
- Corresponds to a release of a specific container image version within a version stream.
For example, if the latest version of RHOSP is 17.1.0 and the release for the container image is 5.161, then the resulting tag for the container image is 17.1.0-5.161.
Major and minor version tags
The Red Hat Container Registry also uses a set of major and minor version tags that link to the latest release for that container image version. For example, both 17.1 and 17.1.0 link to the latest release in the 17.1.0 container stream. If a new minor release of 17.1 occurs, the 17.1 tag links to the latest release for the new minor release stream while the 17.1.0 tag continues to link to the latest release in the 17.1.0 stream.
Setting the tag and tag_from_label parameters
In your containers-prepare-parameter.yaml file, the ContainerImagePrepare parameter contains tag and tag_from_label sub-parameters. You can use tag or tag_from_label to determine which container image to download:
tag-
director uses
tagto pull an image only based on major or minor version tags, which the Red Hat Container Registry links to the latest image release within a version stream. tag_from_label-
director uses
tag_from_labelto perform a metadata inspection of each container image and generates a tag to pull the corresponding image.
The tag parameter always takes precedence over the tag_from_label parameter. To use tag_from_label, omit the tag parameter from your container preparation configuration.
Setting the tag parameter
The default value for tag is the major version for your RHOSP version, for example 17.1. This value always corresponds to the latest minor version and release.
To change to a specific minor version for RHOSP container images, set the tag to a minor version. For example, to change to 17.1.2, set tag to 17.1.2.
When you set tag, director always downloads the latest container image release for the version set in tag during installation and updates, including stack updates.
If you are doing a stack update, you might not want the latest container image but the container image that matches your environment. In this case, omit the tag parameter from your container preparation configuration and specify tag_from_label only. The tag_from_label parameter uses the installed RHOSP version to determine the value for the tag to use as part of the update process.
Setting the tag_from_label parameter
If you do not set tag, director uses the value of tag_from_label in conjunction with the latest major version.
The tag_from_label parameter generates the tag from the label metadata of the latest container image release it inspects from the Red Hat Container Registry. For example, the labels for a certain container might use the following version and release metadata:
"Labels": {
"release": "5.161",
"version": "17.1.0",
...
}
"Labels": {
"release": "5.161",
"version": "17.1.0",
...
}
The default value for tag_from_label is {version}-{release}, which corresponds to the version and release metadata labels for each container image. For example, if a container image has 17.1.0 set for version and 5.161 set for release, the resulting tag for the container image is 17.1.0-5.161.
7.1.3. Excluding Ceph Storage container images Copier lienLien copié sur presse-papiers!
The default overcloud role configuration uses the default Controller, Compute, and Ceph Storage roles. However, if you use the default role configuration to deploy an overcloud without Ceph Storage nodes, director still pulls the Ceph Storage container images from the Red Hat Container Registry because the images are included as a part of the default configuration.
If your overcloud does not require Ceph Storage containers, you can configure director to not pull the Ceph Storage containers images from the Red Hat Container Registry.
Procedure
Edit the
containers-prepare-parameter.yamlfile and add theceph_images: falseparameter.The following is an example of this file with the parameter bolded:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Save the
containers-prepare-parameter.yamlfile. Create a new container images file for use in the overcloud deployment:
sudo openstack tripleo container image prepare -e containers-prepare-parameter.yaml --output-env-file <new_container_images_file>-
Replace
<new_container_images_file>with the output file that contains the new parameter.
-
Replace
- Add the new container images file to the list of overcloud deployment environment files.
7.1.4. Modifying images during preparation Copier lienLien copié sur presse-papiers!
It is possible to modify images during image preparation, and then immediately deploy the overcloud with modified images.
Red Hat OpenStack Platform (RHOSP) director supports modifying images during preparation for RHOSP containers, not for Ceph containers.
Scenarios for modifying images include:
- As part of a continuous integration pipeline where images are modified with the changes being tested before deployment.
- As part of a development workflow where local changes must be deployed for testing and development.
- When changes must be deployed but are not available through an image build pipeline. For example, adding proprietary add-ons or emergency fixes.
To modify an image during preparation, invoke an Ansible role on each image that you want to modify. The role takes a source image, makes the requested changes, and tags the result. The prepare command can push the image to the destination registry and set the heat parameters to refer to the modified image.
The Ansible role tripleo-modify-image conforms with the required role interface and provides the behaviour necessary for the modify use cases. Control the modification with the modify-specific keys in the ContainerImagePrepare parameter:
-
modify_rolespecifies the Ansible role to invoke for each image to modify. -
modify_append_tagappends a string to the end of the source image tag. This makes it obvious that the resulting image has been modified. Use this parameter to skip modification if thepush_destinationregistry already contains the modified image. Changemodify_append_tagwhenever you modify the image. -
modify_varsis a dictionary of Ansible variables to pass to the role.
To select a use case that the tripleo-modify-image role handles, set the tasks_from variable to the required file in that role.
While developing and testing the ContainerImagePrepare entries that modify images, run the image prepare command without any additional options to confirm that the image is modified as you expect:
sudo openstack tripleo container image prepare \ -e ~/containers-prepare-parameter.yaml
sudo openstack tripleo container image prepare \
-e ~/containers-prepare-parameter.yaml
To use the openstack tripleo container image prepare command, your undercloud must contain a running image-serve registry. As a result, you cannot run this command before a new undercloud installation because the image-serve registry will not be installed. You can run this command after a successful undercloud installation.
7.1.5. Updating existing packages on container images Copier lienLien copié sur presse-papiers!
You can update the existing packages on the container images for Red Hat OpenStack Platform (RHOSP) containers.
Red Hat OpenStack Platform (RHOSP) director supports updating existing packages on container images for RHOSP containers, not for Ceph containers.
Procedure
- Download the RPM packages for installation on the container images.
Edit the
containers-prepare-parameter.yamlfile to update all packages on the container images:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Save the
containers-prepare-parameter.yamlfile. -
Include the
containers-prepare-parameter.yamlfile when you run theopenstack overcloud deploycommand.
7.1.6. Installing additional RPM files to container images Copier lienLien copié sur presse-papiers!
You can install a directory of RPM files in your container images. This is useful for installing hotfixes, local package builds, or any package that is not available through a package repository.
Red Hat OpenStack Platform (RHOSP) director supports installing additional RPM files to container images for RHOSP containers, not for Ceph containers.
When you modify container images in existing deployments, you must then perform a minor update to apply the changes to your overcloud. For more information, see Performing a minor update of Red Hat OpenStack Platform.
Procedure
The following example
ContainerImagePrepareentry installs some hotfix packages on only thenova-computeimage:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.1.7. Modifying container images with a custom Dockerfile Copier lienLien copié sur presse-papiers!
You can specify a directory that contains a Dockerfile to make the required changes. When you invoke the tripleo-modify-image role, the role generates a Dockerfile.modified file that changes the FROM directive and adds extra LABEL directives.
Red Hat OpenStack Platform (RHOSP) director supports modifying container images with a custom Dockerfile for RHOSP containers, not for Ceph containers.
Procedure
The following example runs the custom Dockerfile on the
nova-computeimage:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The following example shows the
/home/stack/nova-custom/Dockerfilefile. After you run anyUSERroot directives, you must switch back to the original image default user:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.1.8. Preparing a Satellite server for container images Copier lienLien copié sur presse-papiers!
Red Hat Satellite 6 offers registry synchronization capabilities. This provides a method to pull multiple images into a Satellite server and manage them as part of an application life cycle. The Satellite also acts as a registry for other container-enabled systems to use. For more information about managing container images, see Managing Container Images in the Red Hat Satellite 6 Content Management Guide.
The examples in this procedure use the hammer command line tool for Red Hat Satellite 6 and an example organization called ACME. Substitute this organization for your own Satellite 6 organization.
This procedure requires authentication credentials to access container images from registry.redhat.io. Instead of using your individual user credentials, Red Hat recommends creating a registry service account and using those credentials to access registry.redhat.io content. For more information, see "Red Hat Container Registry Authentication".
Procedure
Create a list of all container images:
sudo podman search --limit 1000 "registry.redhat.io/rhosp-rhel9" --format="{{ .Name }}" | sort > satellite_images sudo podman search --limit 1000 "registry.redhat.io/rhceph" | grep <ceph_dashboard_image_file> sudo podman search --limit 1000 "registry.redhat.io/rhceph" | grep <ceph_image_file> sudo podman search --limit 1000 "registry.redhat.io/openshift4" | grep ose-prometheus$ sudo podman search --limit 1000 "registry.redhat.io/rhosp-rhel9" --format="{{ .Name }}" | sort > satellite_images $ sudo podman search --limit 1000 "registry.redhat.io/rhceph" | grep <ceph_dashboard_image_file> $ sudo podman search --limit 1000 "registry.redhat.io/rhceph" | grep <ceph_image_file> $ sudo podman search --limit 1000 "registry.redhat.io/openshift4" | grep ose-prometheusCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<ceph_dashboard_image_file>with the name of the image file for the version of Red Hat Ceph Storage that your deployment uses:-
Red Hat Ceph Storage 5:
rhceph-5-dashboard-rhel8 -
Red Hat Ceph Storage 6:
rhceph-6-dashboard-rhel9
-
Red Hat Ceph Storage 5:
Replace
<ceph_image_file>with the name of the image file for the version of Red Hat Ceph Storage that your deployment uses:-
Red Hat Ceph Storage 5:
rhceph-5-rhel8 Red Hat Ceph Storage 6:
rhceph-6-rhel9NoteThe
openstack-ovn-bgp-agentimage is located atregistry.redhat.io/rhosp-rhel9/openstack-ovn-bgp-agent-rhel9:17.1.
-
Red Hat Ceph Storage 5:
If you plan to install Ceph and enable the Ceph Dashboard, you need the following ose-prometheus containers:
registry.redhat.io/openshift4/ose-prometheus-node-exporter:v4.12 registry.redhat.io/openshift4/ose-prometheus:v4.12 registry.redhat.io/openshift4/ose-prometheus-alertmanager:v4.12
registry.redhat.io/openshift4/ose-prometheus-node-exporter:v4.12 registry.redhat.io/openshift4/ose-prometheus:v4.12 registry.redhat.io/openshift4/ose-prometheus-alertmanager:v4.12Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Copy the
satellite_imagesfile to a system that contains the Satellite 6hammertool. Alternatively, use the instructions in the Hammer CLI Guide to install thehammertool to the undercloud. Run the following
hammercommand to create a new product (OSP Containers) in your Satellite organization:hammer product create \ --organization "ACME" \ --name "OSP Containers"
$ hammer product create \ --organization "ACME" \ --name "OSP Containers"Copy to Clipboard Copied! Toggle word wrap Toggle overflow This custom product will contain your images.
Add the overcloud container images from the
satellite_imagesfile:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the Ceph Storage container image:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<ceph_image_file>with the name of the image file for the version of Red Hat Ceph Storage that your deployment uses:-
Red Hat Ceph Storage 5:
rhceph-5-rhel8 Red Hat Ceph Storage 6:
rhceph-6-rhel9NoteIf you want to install the Ceph dashboard, include
--name <ceph_dashboard_image_name>in thehammer repository createcommand:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<ceph_dashboard_image_file>with the name of the image file for the version of Red Hat Ceph Storage that your deployment uses:-
Red Hat Ceph Storage 5:
rhceph-5-dashboard-rhel8 -
Red Hat Ceph Storage 6:
rhceph-6-dashboard-rhel9
-
Red Hat Ceph Storage 5:
-
Red Hat Ceph Storage 5:
Synchronize the container images:
hammer product synchronize \ --organization "ACME" \ --name "OSP Containers"
$ hammer product synchronize \ --organization "ACME" \ --name "OSP Containers"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Wait for the Satellite server to complete synchronization.
NoteDepending on your configuration,
hammermight ask for your Satellite server username and password. You can configurehammerto automatically login using a configuration file. For more information, see the Authentication section in the Hammer CLI Guide.-
If your Satellite 6 server uses content views, create a new content view version to incorporate the images and promote it along environments in your application life cycle. This largely depends on how you structure your application lifecycle. For example, if you have an environment called
productionin your lifecycle and you want the container images to be available in that environment, create a content view that includes the container images and promote that content view to theproductionenvironment. For more information, see Managing Content Views. Check the available tags for the
baseimage:hammer docker tag list --repository "base" \ --organization "ACME" \ --lifecycle-environment "production" \ --product "OSP Containers"
$ hammer docker tag list --repository "base" \ --organization "ACME" \ --lifecycle-environment "production" \ --product "OSP Containers"Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command displays tags for the OpenStack Platform container images within a content view for a particular environment.
Return to the undercloud and generate a default environment file that prepares images using your Satellite server as a source. Run the following example command to generate the environment file:
sudo openstack tripleo container image prepare default \ --output-env-file containers-prepare-parameter.yaml
$ sudo openstack tripleo container image prepare default \ --output-env-file containers-prepare-parameter.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
--output-env-fileis an environment file name. The contents of this file include the parameters for preparing your container images for the undercloud. In this case, the name of the file iscontainers-prepare-parameter.yaml.
-
Edit the
containers-prepare-parameter.yamlfile and modify the following parameters:-
push_destination- Set this totrueorfalsedepending on your chosen container image management strategy. If you set this parameter tofalse, the overcloud nodes pull images directly from the Satellite. If you set this parameter totrue, the director pulls the images from the Satellite to the undercloud registry and the overcloud pulls the images from the undercloud registry. -
namespace- The URL of the registry on the Satellite server. name_prefix- The prefix is based on a Satellite 6 convention. This differs depending on whether you use content views:-
If you use content views, the structure is
[org]-[environment]-[content view]-[product]-. For example:acme-production-myosp17-osp_containers-. -
If you do not use content views, the structure is
[org]-[product]-. For example:acme-osp_containers-.
-
If you use content views, the structure is
-
ceph_namespace,ceph_image,ceph_tag- If you use Ceph Storage, include these additional parameters to define the Ceph Storage container image location. Note thatceph_imagenow includes a Satellite-specific prefix. This prefix is the same value as thename_prefixoption.
-
The following example environment file contains Satellite-specific parameters:
To use a specific container image version stored on your Red Hat Satellite Server, set the tag key-value pair to the specific version in the set dictionary. For example, to use the 17.1.2 image stream, set tag: 17.1.2 in the set dictionary.
You must define the containers-prepare-parameter.yaml environment file in the undercloud.conf configuration file, otherwise the undercloud uses the default values:
container_images_file = /home/stack/containers-prepare-parameter.yaml
container_images_file = /home/stack/containers-prepare-parameter.yaml
7.1.9. Deploying a vendor plugin Copier lienLien copié sur presse-papiers!
To use some third-party hardware as a Block Storage back end, you must deploy a vendor plugin. The following example demonstrates how to deploy a vendor plugin to use Dell EMC hardware as a Block Storage back end.
Procedure
Create a new container images file for your overcloud:
sudo openstack tripleo container image prepare default \ --local-push-destination \ --output-env-file containers-prepare-parameter-dellemc.yaml$ sudo openstack tripleo container image prepare default \ --local-push-destination \ --output-env-file containers-prepare-parameter-dellemc.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Edit the
containers-prepare-parameter-dellemc.yamlfile. Add an
excludeparameter to the strategy for the main Red Hat OpenStack Platform container images. Use this parameter to exclude the container image that the vendor container image will replace. In the example, the container image is thecinder-volumeimage:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add a new strategy to the
ContainerImagePrepareparameter that includes the replacement container image for the vendor plugin:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the authentication details for the registry.connect.redhat.com registry to the
ContainerImageRegistryCredentialsparameter:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Save the
containers-prepare-parameter-dellemc.yamlfile. Include the
containers-prepare-parameter-dellemc.yamlfile with any deployment commands, such as asopenstack overcloud deploy:openstack overcloud deploy --templates
$ openstack overcloud deploy --templates ... -e containers-prepare-parameter-dellemc.yaml ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow When director deploys the overcloud, the overcloud uses the vendor container image instead of the standard container image.
- IMPORTANT
-
The
containers-prepare-parameter-dellemc.yamlfile replaces the standardcontainers-prepare-parameter.yamlfile in your overcloud deployment. Do not include the standardcontainers-prepare-parameter.yamlfile in your overcloud deployment. Retain the standardcontainers-prepare-parameter.yamlfile for your undercloud installation and updates.
7.2. Performing advanced container image management Copier lienLien copié sur presse-papiers!
The default container image configuration suits most environments. In some situations, your container image configuration might require some customization, such as version pinning.
7.2.1. Pinning container images for the undercloud Copier lienLien copié sur presse-papiers!
In certain circumstances, you might require a set of specific container image versions for your undercloud. In this situation, you must pin the images to a specific version. To pin your images, you must generate and modify a container configuration file, and then combine the undercloud roles data with the container configuration file to generate an environment file that contains a mapping of services to container images. Then include this environment file in the custom_env_files parameter in the undercloud.conf file.
Procedure
-
Log in to the undercloud host as the
stackuser. Run the
openstack tripleo container image prepare defaultcommand with the--output-env-fileoption to generate a file that contains the default image configuration:sudo openstack tripleo container image prepare default \ --output-env-file undercloud-container-image-prepare.yaml
$ sudo openstack tripleo container image prepare default \ --output-env-file undercloud-container-image-prepare.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Modify the
undercloud-container-image-prepare.yamlfile according to the requirements of your environment.-
Remove the
tag:parameter so that director can use thetag_from_label:parameter. Director uses this parameter to identify the latest version of each container image, pull each image, and tag each image on the container registry in director. - Remove the Ceph labels for the undercloud.
-
Ensure that the
neutron_driver:parameter is empty. Do not set this parameter toOVNbecause OVN is not supported on the undercloud. Include your container image registry credentials:
ContainerImageRegistryCredentials: registry.redhat.io: myser: 'p@55w0rd!'ContainerImageRegistryCredentials: registry.redhat.io: myser: 'p@55w0rd!'Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou cannot push container images to the undercloud registry on new underclouds because the
image-serveregistry is not installed yet. You must set thepush_destinationvalue tofalse, or use a custom value, to pull images directly from source. For more information, see Container image preparation parameters.
-
Remove the
Generate a new container image configuration file that uses the undercloud roles file combined with your custom
undercloud-container-image-prepare.yamlfile:sudo openstack tripleo container image prepare \ -r /usr/share/openstack-tripleo-heat-templates/roles_data_undercloud.yaml \ -e undercloud-container-image-prepare.yaml \ --output-env-file undercloud-container-images.yaml
$ sudo openstack tripleo container image prepare \ -r /usr/share/openstack-tripleo-heat-templates/roles_data_undercloud.yaml \ -e undercloud-container-image-prepare.yaml \ --output-env-file undercloud-container-images.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
undercloud-container-images.yamlfile is an environment file that contains a mapping of service parameters to container images. For example, OpenStack Identity (keystone) uses theContainerKeystoneImageparameter to define its container image:ContainerKeystoneImage: undercloud.ctlplane.localdomain:8787/rhosp-rhel9/openstack-keystone:17.1
ContainerKeystoneImage: undercloud.ctlplane.localdomain:8787/rhosp-rhel9/openstack-keystone:17.1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note that the container image tag matches the
{version}-{release}format.-
Include the
undercloud-container-images.yamlfile in thecustom_env_filesparameter in theundercloud.conffile. When you run the undercloud installation, the undercloud services use the pinned container image mapping from this file.
7.2.2. Pinning container images for the overcloud Copier lienLien copié sur presse-papiers!
In certain circumstances, you might require a set of specific container image versions for your overcloud. In this situation, you must pin the images to a specific version. To pin your images, you must create the containers-prepare-parameter.yaml file, use this file to pull your container images to the undercloud registry, and generate an environment file that contains a pinned image list.
For example, your containers-prepare-parameter.yaml file might contain the following content:
The ContainerImagePrepare parameter contains a single rule set. This rule set must not include the tag parameter and must rely on the tag_from_label parameter to identify the latest version and release of each container image. Director uses this rule set to identify the latest version of each container image, pull each image, and tag each image on the container registry in director.
Procedure
Run the
openstack tripleo container image preparecommand, which pulls all images from the source defined in thecontainers-prepare-parameter.yamlfile. Include the--output-env-fileto specify the output file that will contain the list of pinned container images:sudo openstack tripleo container image prepare -e /home/stack/templates/containers-prepare-parameter.yaml --output-env-file overcloud-images.yaml
$ sudo openstack tripleo container image prepare -e /home/stack/templates/containers-prepare-parameter.yaml --output-env-file overcloud-images.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
overcloud-images.yamlfile is an environment file that contains a mapping of service parameters to container images. For example, OpenStack Identity (keystone) uses theContainerKeystoneImageparameter to define its container image:ContainerKeystoneImage: undercloud.ctlplane.localdomain:8787/rhosp-rhel9/openstack-keystone:17.1
ContainerKeystoneImage: undercloud.ctlplane.localdomain:8787/rhosp-rhel9/openstack-keystone:17.1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note that the container image tag matches the
{version}-{release}format.Include the
containers-prepare-parameter.yamlandovercloud-images.yamlfiles in that specific order with your environment file collection when you run theopenstack overcloud deploycommand:openstack overcloud deploy --templates \ ...$ openstack overcloud deploy --templates \ ... -e /home/stack/containers-prepare-parameter.yaml \ -e /home/stack/overcloud-images.yaml \ ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The overcloud services use the pinned images listed in the overcloud-images.yaml file.