2.6. 将 hub 集群配置为使用断开连接的镜像 registry
您可以将 hub 集群配置为使用断开连接的镜像 registry 作为断开连接的环境。
先决条件
- 已安装 Red Hat Advanced Cluster Management (RHACM) 2.11 的断开连接的 hub 集群安装。
-
您已在 HTTP 服务器中托管
rootfs
和iso
镜像。有关 Mirroring the OpenShift Container Platform image repository 的信息,请参阅附加资源部分。
警告
如果为 HTTP 服务器启用 TLS,您必须确认 root 证书由客户端信任的颁发机构签名,并验证 OpenShift Container Platform hub 和受管集群和 HTTP 服务器之间的可信证书链。使用配置了不受信任的证书的服务器可防止将镜像下载到创建镜像中。不支持使用不受信任的 HTTPS 服务器。
流程
创建包含镜像 registry 配置的
ConfigMap
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
ConfigMap
命名空间必须设置为multicluster-engine
。- 2
- 创建镜像 registry 时使用的镜像 registry 证书。
- 3
- 镜像 registry 的配置文件。镜像 registry 配置将镜像信息添加到发现镜像的
/etc/containers/registries.conf
文件中。当信息传递给安装程序时,镜像信息会存储在install-config.yaml
文件的imageContentSources
部分中。在 hub 集群上运行的 Assisted Service pod 从配置的镜像 registry 获取容器镜像。 - 4
- 镜像 registry 的 URL。在配置镜像 registry 时,您必须运行
oc adm release mirror
命令使用imageContentSources
部分中的 URL。如需更多信息,请参阅 Mirroring the OpenShift Container Platform image repository 部分。 - 5
registries.conf
文件中定义的 registry 必须由存储库范围,而不是由 registry 范围。在本例中,quay.io/example-repository
和mirror1.registry.corp.com:5000/example-repository
存储库都限定了example-repository
存储库。
这会更新
AgentServiceConfig
自定义资源中的mirrorRegistryRef
,如下所示:输出示例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
重要
集群安装过程中需要一个有效的 NTP 服务器。确保有合适的 NTP 服务器可用,并可通过断开连接的网络从安装的系统访问。