4.3. 在断开连接的环境中安装


重要: 您需要将所需的镜像下载到镜像 registry 中,以便在断开连接的环境中安装 Operator。如果没有下载,您可能会在部署过程中收到 ImagePullBackOff 错误。

按照以下步骤在断开连接的环境中为 Kubernetes Operator 安装多集群引擎:

  1. 创建镜像 registry。如果您还没有镜像 registry,请按照 Red Hat OpenShift Container Platform 文档中的为断开连接的环境创建镜像的容器镜像的步骤来创建。

    如果已有镜像 registry,可以配置和使用现有 registry。

  2. 注: 对于裸机,您需要在 install-config.yaml 文件中为断开连接的 registry 提供证书信息。要访问受保护的断开连接的 registry 中的镜像,您必须提供证书信息,以便 Kubernetes operator 的多集群引擎可以访问 registry。

    1. 复制 registry 中的证书信息。
    2. 在编辑器中打开 install-config.yaml 文件。
    3. 找到 additionalTrustBundle: | 条目。
    4. additionalTrustBundle 行后添加证书信息。内容应类似以下示例:

      additionalTrustBundle: |
        -----BEGIN CERTIFICATE-----
        certificate_content
        -----END CERTIFICATE-----
      sshKey: >-
      Copy to Clipboard Toggle word wrap
  3. 重要: 如果需要以下监管策略,则需要额外的镜像 registry:

    • Container Security Operator 策略:镜像位于源 registry.redhat.io/quay 中。
    • Compliance operator 策略:镜像位于源 registry.redhat.io/compliance
    • Gatekeeper operator 策略:镜像位于源 registry.redhat.io/rhacm2

      参阅以下所有三个 operator 的镜像列表示例:

        - mirrors:
          - <your_registry>/rhacm2
          source: registry.redhat.io/rhacm2
        - mirrors:
          - <your_registry>/quay
          source: registry.redhat.io/quay
        - mirrors:
          - <your_registry>/compliance
          source: registry.redhat.io/compliance
    Copy to Clipboard Toggle word wrap
  4. 保存 install-config.yaml 文件。
  5. 创建一个包含 ImageContentSourcePolicy 的 YAML 文件,其名称为 rhacm-policy.yaml注: 如果您在正在运行的集群中修改此操作,则会导致所有节点的滚动重启。

    apiVersion: operator.openshift.io/v1alpha1
    kind: ImageContentSourcePolicy
    metadata:
      name: mce-repo
    spec:
      repositoryDigestMirrors:
      - mirrors:
        - mirror.registry.com:5000/multicluster-engine
        source: registry.redhat.io/multicluster-engine
    Copy to Clipboard Toggle word wrap
  6. 输入以下命令应用 ImageContentSourcePolicy 文件:

    oc apply -f mce-policy.yaml
    Copy to Clipboard Toggle word wrap
  7. 启用断开连接的 Operator Lifecycle Manager Red Hat Operator 和 Community Operator。

    Kubernetes operator 的多集群引擎包含在 Operator Lifecycle Manager Red Hat Operator 目录中。

  8. 为 Red Hat Operator 目录配置离线 Operator Lifecycle Manager。按照 Red Hat OpenShift Container Platform 文档中 受限网络部分中使用 Operator Lifecycle Manager 中的步骤操作。
  9. 现在,您已在断开连接的 Operator Lifecycle Manager 中已有镜像,从 Operator Lifecycle Manager 目录继续为 Kubernetes operator 安装多集群引擎。

如需了解所需步骤,请参阅在线安装

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat