Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

4.9. 配置 registry 位置

如果您在 registry.redhat.io 中使用默认 registry,则必须设置以下变量:

oreg_url=registry.redhat.io/openshift3/ose-${component}:${version}
oreg_auth_user="<user>"
oreg_auth_password="<password>"

有关设置 registry 访问令牌的更多信息,请参阅 Red Hat Container Registry 身份验证

如果您使用 registry.redhat.io 以外的默认镜像 registry,请在 /etc/ansible/hosts 文件中指定 registry。

oreg_url=example.com/openshift3/ose-${component}:${version}
openshift_examples_modify_imagestreams=true

表 4.7. registry 变量

变量用途

oreg_url

设置备用镜像位置。如果您没有使用默认的 registry.redhat.io,则需要设置它。默认组件从 oreg_url 值继承镜像前缀和版本。对于需要身份验证的默认 registry,需要指定 oreg_auth_useroreg_auth_password

openshift_examples_modify_imagestreams

如果指向默认 registry 以外的 registry,则设置为 true。将镜像流位置改为 oreg_url

oreg_auth_user

如果 oreg_url 指向需要身份验证的 registry,使用 oreg_auth_user 变量来提供您的用户名。您还必须提供密码作为 oreg_auth_password 的参数值。如果使用默认 registry,请指定可访问 registry.redhat.io 的用户。

oreg_auth_password

如果 oreg_url 指向需要身份验证的 registry,使用 oreg_auth_password 变量来提供您的密码。还必须将您的用户名作为 oreg_auth_user 参数值提供。如果使用默认 registry,指定该用户的密码或令牌。

注意

默认 registry 需要身份验证令牌。如需更多信息,请参阅访问并配置 Red Hat Registry

例如:

oreg_url=example.com/openshift3/ose-${component}:${version}
oreg_auth_user=${user_name}
oreg_auth_password=${password}
openshift_examples_modify_imagestreams=true