第 2 章 使用 Operator 在 air-gapped 环境中安装 Red Hat Developer Hub


在在受限网络中运行的 OpenShift Container Platform 集群上,无法使用公共资源。但是,部署 Red Hat Developer Hub Operator 并运行 Developer Hub 需要以下公共资源:

  • Operator 镜像(bundle, operator, catalog)
  • 操作对象镜像(RHDH、PostgreSQL)

要使这些资源可用,请将它们替换为 OpenShift Container Platform 集群可访问的镜像 registry 中的等效资源。

您可以使用一个帮助程序脚本来镜像所需的镜像,并提供必要的配置,以确保在安装 Red Hat Developer Hub Operator 并创建 Developer Hub 实例时将使用这些镜像。

注意

此脚本需要一个目标镜像 registry,如果 OpenShift Container Platform 集群准备好在受限网络中操作,则应该已安装该 registry。但是,如果您准备集群以断开连接使用,您可以使用脚本在集群中部署镜像 registry,并将其用于镜像过程。

先决条件

注意

内部 OpenShift Container Platform 集群镜像 registry 不能用作目标镜像 registry。请参阅关于镜像 registry

  • 如果要创建自己的镜像 registry,请参阅为 Red Hat OpenShift 创建带有 mirror registry 的 mirror registry。
  • 如果您还没有镜像 registry,您可以使用 helper 脚本为您创建一个,并需要以下额外先决条件:

    • 已安装 cURL 软件包。对于 Red Hat Enterprise Linux,可以通过安装 curl 软件包来使用 curl 命令。要将 curl 用于其他平台,请查看 cURL 网站
    • htpasswd 命令可用。对于 Red Hat Enterprise Linux,可以通过安装 httpd-tools 软件包来使用 htpasswd 命令。

流程

  1. 下载并运行镜像脚本,以安装自定义 Operator 目录并镜像相关镜像: prepare-restricted-environment.sh (source)。

    curl -sSLO https://raw.githubusercontent.com/redhat-developer/rhdh-operator/release-1.3/.rhdh/scripts/prepare-restricted-environment.sh
    
    # if you do not already have a target mirror registry
    # and want the script to create one for you
    # use the following example:
    bash prepare-restricted-environment.sh \
       --prod_operator_index "registry.redhat.io/redhat/redhat-operator-index:v4.17" \
       --prod_operator_package_name "rhdh" \
       --prod_operator_bundle_name "rhdh-operator" \
       --prod_operator_version "v1.3.5"
    
    # if you already have a target mirror registry
    # use the following example:
    bash prepare-restricted-environment.sh \
       --prod_operator_index "registry.redhat.io/redhat/redhat-operator-index:v4.17" \
       --prod_operator_package_name "rhdh" \
       --prod_operator_bundle_name "rhdh-operator" \
       --prod_operator_version "v1.3.5" \
       --use_existing_mirror_registry "my_registry"
    注意

    该脚本可能需要几分钟才能完成,因为它将多个镜像复制到镜像 registry。

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部