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

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

按照以下步骤在断开连接的环境中安装 Red Hat Advanced Cluster Management:

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

    注: 确保按照 OpenShift Container Platform 文档中的从镜像 Operator 目录中提取 OperatorHub 的步骤。

  2. 镜像 operator 目录。按照 Mirroring Operator catalogs for use with disconnected clusters 中的步骤对 operator 进行了镜像。

    注: 如果您要从现有的 Red Hat Operator 索引镜像中修剪软件包,请确保修剪 advanced-cluster-management 软件包。请参阅过滤基于 SQLite 的索引镜像

    注: 对于裸机,您需要在 install-config.yaml 文件中为断开连接的 registry 提供证书信息。要访问受保护的断开连接的 registry 中的镜像,必须提供证书信息,以便 Red Hat Advanced Cluster Management 可以访问 registry。

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

      additionalTrustBundle: |
        -----BEGIN CERTIFICATE-----
        certificate_content
        -----END CERTIFICATE-----
      sshKey: >-
  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
  4. 保存 install-config.yaml 文件。
  5. 创建一个包含 ImageContentSourcePolicy 的 YAML 文件,其名称为 rhacm-policy.yaml注: 如果您在正在运行的集群中修改此操作,则会导致所有节点的滚动重启。

    apiVersion: operator.openshift.io/v1alpha1
    kind: ImageContentSourcePolicy
    metadata:
      name: rhacm-repo
    spec:
      repositoryDigestMirrors:
      - mirrors:
        - mirror.registry.com:5000/rhacm2
        source: registry.redhat.io/rhacm2
  6. 输入以下命令应用 ImageContentSourcePolicy 文件:

    oc apply -f rhacm-policy.yaml
  7. 启用断开连接的 Operator Lifecycle Manager Red Hat Operator 和 Community Operator。

    Red Hat Advanced Cluster Management 包括在 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 目录继续安装 Red Hat Advanced Cluster Management for Kubernetes。

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