2.6. 配置主机以进行镜像 registry 访问


要将 MicroShift 主机配置为使用镜像 registry,您必须通过创建一个配置文件来将红帽 registry 主机名映射到镜像(mirror)来提供 MicroShift 主机对 registry 的访问。

先决条件

  • 您的镜像主机可访问互联网。
  • 镜像主机可以访问镜像 registry。
  • 您已配置了镜像 registry 以在受限网络中使用。
  • 您下载了 pull secret,并将其修改为包含镜像存储库的身份验证。

流程

  1. 登录到您的 MicroShift 主机。
  2. 通过完成以下步骤,在访问镜像 registry 的任何主机上启用 SSL 证书信任:

    1. rootCA.pem 文件从镜像 registry (如 < registry_path>/quay-rootCA )复制到 /etc/pki/ca-trust/source/anchors 目录中的 MicroShift 主机。
    2. 运行以下命令,在系统范围的信任存储配置中启用证书:

      $ sudo update-ca-trust
      Copy to Clipboard
  3. 创建 /etc/containers/registries.conf.d/999-microshift-mirror.conf 配置文件,将红帽 registry 主机名映射到镜像 registry:

    镜像配置文件示例

    [[registry]]
        prefix = ""
        location = "<registry_host>:<port>" 
    1
    
        mirror-by-digest-only = true
        insecure = false
    
    [[registry]]
        prefix = ""
        location = "quay.io"
        mirror-by-digest-only = true
    [[registry.mirror]]
        location = "<registry_host>:<port>"
        insecure = false
    
    [[registry]]
        prefix = ""
        location = "registry.redhat.io"
        mirror-by-digest-only = true
    [[registry.mirror]]
        location = "<registry_host>:<port>"
        insecure = false
    
    [[registry]]
        prefix = ""
        location = "registry.access.redhat.com"
        mirror-by-digest-only = true
    [[registry.mirror]]
        location = "<registry_host>:<port>"
        insecure = false
    Copy to Clipboard

    1
    <registry_host>:<port > 替换为镜像 registry 服务器的主机名和端口,例如 < microshift-quay:8443 >。
  4. 运行以下命令来启用 MicroShift 服务:

    $ sudo systemctl enable microshift
    Copy to Clipboard
  5. 运行以下命令来重启主机:

    $ sudo reboot
    Copy to Clipboard
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat