3.7. 容器镜像准备参数

用于准备您的容器的默认文件 (containers-prepare-parameter.yaml) 包含 ContainerImagePrepare heat 参数。此参数定义一个用于准备一系列镜像的策略列表:

parameter_defaults:
  ContainerImagePrepare:
  - (strategy one)
  - (strategy two)
  - (strategy three)
  ...

每一策略接受一组子参数,它们定义要使用哪些镜像以及对这些镜像执行哪些操作。下表包含有关您可与每个 ContainerImagePrepare 策略配合使用的子参数的信息:

参数描述

excludes

用于从策略中排除镜像名称的正则表达式列表。

includes

用于在策略中包含的正则表达式列表。至少一个镜像名称必须与现有镜像匹配。如果指定了 includes,将忽略所有 excludes

modify_append_tag

要附加到目标镜像标签的字符串。例如,如果使用标签 16.2.3-5.161 拉取镜像并将 modify_append_tag 设置为 -hotfix,director 会将最终镜像标记为 16.2.3-5.161-hotfix。

modify_only_with_labels

过滤想要修改的镜像的镜像标签字典。如果镜像与定义的标签匹配,则 director 将该镜像包括在修改过程中。

modify_role

在上传期间但在将镜像推送到目标 registry 之前运行的 ansible 角色名称字符串。

modify_vars

要传递给 modify_role 的变量的字典。

push_destination

定义用于在上传过程中要将镜像推送到的 registry 的命名空间。

  • 如果设为 true,则使用主机名将 push_destination 设置为 undercloud registry 命名空间,这是建议的方法。
  • 如果设置为 false,则不会推送到本地 registry,节点直接从源拉取镜像。
  • 如果设置为自定义值,则 director 将镜像推送到外部本地 registry。

当直接从 Red Hat Container Catalog 拉取镜像时,如果在生产环境中将此参数设置为 false,则所有 overcloud 节点都将通过外部连接同时从 Red Hat Container Catalog 拉取镜像,这可能会导致出现带宽问题。仅使用 false 直接从托管容器镜像的 Red Hat Satellite Server 拉取。

如果 push_destination 参数设置为 false 或未定义,且远程 registry 需要身份验证,请将 ContainerImageRegistryLogin 参数设置为 true,并使用 ContainerImageRegistryCredentials 参数包含凭据。

pull_source

从中拉取原始容器镜像的源 registry 。

set

用于定义从何处获取初始镜像的 key: value 定义的字典。

tag_from_label

使用指定容器镜像元数据标签的值为每个镜像创建标签,并拉取该标记的镜像。例如,如果设置了 tag_from_label: {version}-{release},则 director 会使用 versionrelease 标签来构造新标签。对于一个容器,version 可能会设置为 16.2.3,release 可能会设置为 5.161,这会产生标签 16.2.3-5.161。仅当未在 set 字典中定义 tag 时,director 才使用此参数。

重要

将镜像推送到 undercloud 时,请使用 push_destination: true 而不是 push_destination: UNDERCLOUD_IP:PORTpush_destination: true 方法在 IPv4 和 IPv6 地址之间提供了一定程度的一致性。

set 参数接受一组 key: value 定义:

描述

ceph_image

Ceph Storage 容器镜像的名称。

ceph_namespace

Ceph Storage 容器镜像的命名空间。

ceph_tag

Ceph Storage 容器镜像的标签。

ceph_alertmanager_image

ceph_alertmanager_namespace

ceph_alertmanager_tag

Ceph Storage Alert Manager 容器镜像的名称、命名空间和标签。

ceph_grafana_image

ceph_grafana_namespace

ceph_grafana_tag

Ceph Storage Grafana 容器镜像的名称、命名空间和标签。

ceph_node_exporter_image

ceph_node_exporter_namespace

ceph_node_exporter_tag

Ceph Storage Node Exporter 容器镜像的名称、命名空间和标签。

ceph_prometheus_image

ceph_prometheus_namespace

ceph_prometheus_tag

Ceph Storage Prometheus 容器镜像的名称、命名空间和标签。

name_prefix

各个 OpenStack 服务镜像的前缀。

name_suffix

各个 OpenStack 服务镜像的后缀。

namespace

各个 OpenStack 服务镜像的命名空间。

neutron_driver

用于确定要使用的 OpenStack Networking (neutron) 容器的驱动程序。null 值代表使用标准的 neutron-server 容器。设为 ovn 可使用基于 OVN 的容器。

tag

为来自源的所有镜像设置特定的标签。如果没有定义,director 将 Red Hat OpenStack Platform 版本号用作默认值。此参数优先于 tag_from_label 值。

注意

容器镜像使用基于 Red Hat OpenStack Platform 版本的多流标签。这意味着不再有 latest 标签。