3.5. 容器镜像准备参数


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

Copy to Clipboard Toggle word wrap
parameter_defaults:
  ContainerImagePrepare:
  - (strategy one)
  - (strategy two)
  - (strategy three)
  ...

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

参数描述

excludes

从策略中排除的镜像名称子字符串列表。

includes

包括在策略中的镜像名称子字符串列表。至少一个镜像名称必须与现有镜像匹配。如果指定了 includes,将忽略所有 excludes

modify_append_tag

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

modify_only_with_labels

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

modify_role

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

modify_vars

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

push_destination

用于在上传过程中推送镜像的注册表的命名空间。当为这个参数指定了一个命名空间后,所有镜像参数也会使用这个命名空间。如果设为 true,则 push_destination 设为 undercloud 注册表命名空间。建议不要在生产环境中将此参数设置为 false。如果此参数被设置为 false 或未提供,且远程 registry 需要身份验证,请将 ContainerImageRegistryLogin 参数设置为 true,并使用 ContainerImageRegistryCredentials 参数提供凭证。

pull_source

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

set

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

tag_from_label

定义标记 (tag) 生成的镜像的标签特征。通常设置为 {version}-{release}

set 参数接受一组 key: value 定义。下表包含键的相关信息:

描述

ceph_image

Ceph Storage 容器镜像的名称。

ceph_namespace

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

ceph_tag

Ceph Storage 容器镜像的标签。

name_prefix

各个 OpenStack 服务镜像的前缀。

name_suffix

各个 OpenStack 服务镜像的后缀。

namespace

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

neutron_driver

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

tag

director 用于识别要从源 registry 中拉取的镜像的标签。通常,使用此密钥为默认值,即 Red Hat OpenStack Platform 版本号。

注意

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

ContainerImageRegistryCredentials 参数将容器 registry 映射到用户名和密码以对该 registy 进行验证。

如果容器 registry 需要用户名和密码,则可使用 ContainerImageRegistryCredentials 以下语法包括它们的值:

Copy to Clipboard Toggle word wrap
  ContainerImagePrepare:
  - push_destination: 192.168.24.1:8787
    set:
      namespace: registry.redhat.io/...
      ...
  ContainerImageRegistryCredentials:
    registry.redhat.io:
      my_username: my_password

在示例中,用身份验证凭据替换 my_usernamemy_password。红帽建议创建一个 registry 服务帐户并使用这些凭据访问 registry.redhat.io 内容,而不使用您的个人用户凭据。有关更多信息,请参阅“红帽容器 registry 身份验证”

ContainerImageRegistryLogin 参数用于控制所部署系统的 registry 登录。如果将 push_destination 设为 false 或没有使用,则此值必须设为 true

Copy to Clipboard Toggle word wrap
  ContainerImagePrepare:
  - set:
      namespace: registry.redhat.io/...
      ...
  ContainerImageRegistryCredentials:
    registry.redhat.io:
      my_username: my_password
  ContainerImageRegistryLogin: true
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat, Inc.