在 air-gapped 环境中安装 Red Hat Developer Hub


Red Hat Developer Hub 1.4

Red Hat Customer Content Services

摘要

Red Hat Developer Hub 是一个用于构建开发人员门户的企业级平台。管理用户可配置角色、权限和其他设置,以便其他授权用户使用 Operator 或 Helm Chart 在任何受支持的平台上部署 air-gapped Developer Hub 实例。

第 1 章 air-gapped 环境

air-gapped 环境(也称为 air-gapped 网络或隔离网络)通过物理隔离系统或网络来确保安全性。建立这个隔离,以防止 air-gapped 系统和外部源之间的未授权访问、数据传输或通信。

您可以在 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.4/.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.4.3"
    
    # 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.4.3" \
       --use_existing_mirror_registry "my_registry"
    注意

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

air-gapped 环境(也称为 air-gapped 网络或隔离网络)通过物理隔离系统或网络来确保安全性。建立这个隔离,以防止 air-gapped 系统和外部源之间的未授权访问、数据传输或通信。

您可以在 air-gapped 环境中安装 Red Hat Developer Hub,以确保安全性并满足特定的法规要求。

要在 air-gapped 环境中安装 Developer Hub,您必须可以访问 registry.redhat.io 和 air-gapped 环境的 registry。

先决条件

  • 已安装 Red Hat OpenShift Container Platform 4.14 或更高版本。
  • 您可以访问 registry.redhat.io
  • 您可以访问集群的 Red Hat OpenShift Container Platform 镜像 registry。有关公开镜像 registry 的更多信息,请参阅 Red Hat OpenShift Container Platform 文档中有关 公开 registry 的内容。
  • 已在工作站上安装了 OpenShift CLI (oc)。
  • 您已在工作站上安装了 podman 命令行工具。
  • Red Hat Developer Portal 中有一个帐户。

流程

  1. 运行以下命令,使用 OpenShift CLI (oc)登录到 OpenShift Container Platform 帐户:

    oc login -u <user> -p <password> https://api.<hostname>:6443
  2. 运行以下命令,使用 podman 命令行工具登录到 OpenShift Container Platform 镜像 registry:

    podman login -u kubeadmin -p $(oc whoami -t) default-route-openshift-image-registry.<hostname>
    注意

    您可以运行以下命令来获取 OpenShift Container Platform 镜像 registry 的完整主机名,然后在命令中使用主机名登录:

    REGISTRY_HOST=$(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')
    podman login -u kubeadmin -p $(oc whoami -t) $REGISTRY_HOST
  3. 运行以下命令,登录到 podman 中的 registry.redhat.io

    podman login registry.redhat.io

    有关 registry 身份验证的更多信息,请参阅 Red Hat Container Registry 身份验证

  4. 运行以下命令,将 Developer Hub 和 PostgreSQL 镜像从 Red Hat Image registry 拉取到工作站:

    podman pull registry.redhat.io/rhdh/rhdh-hub-rhel9:1.4
    podman pull registry.redhat.io/rhel9/postgresql-15:latest
  5. 运行以下命令,将两个镜像推送到内部 OpenShift Container Platform 镜像 registry:

    podman push --remove-signatures registry.redhat.io/rhdh/rhdh-hub-rhel9:1.4 default-route-openshift-image-registry.<hostname>/<project_name>/rhdh-hub-rhel9:1.4
    podman push --remove-signatures registry.redhat.io/rhel9/postgresql-15:latest default-route-openshift-image-registry.<hostname>/<project_name>/postgresql-15:latest

    有关将镜像直接推送到 OpenShift Container Platform 镜像 registry 的更多信息,请参阅如何直接将镜像推送到 OpenShift 4 registry 中

    重要

    如果发生 x509 错误,请验证您已在 系统上安装了用于 OpenShift Container Platform 路由的 CA 证书

  6. 使用以下命令验证 OpenShift Container Platform 内部 registry 中是否存在这两个镜像:

    oc get imagestream -n my-rhdh-project
  7. 运行以下命令,为这两个镜像启用本地镜像查找:

    oc set image-lookup postgresql-15
    oc set image-lookup  rhdh-hub-rhel9
  8. 进入 YAML 视图,并使用以下值为 backstagepostgresql 更新 image 部分:

    Developer Hub 镜像的值示例

    upstream:
      backstage:
        image:
          registry: ""
          repository: rhdh-hub-rhel9
          tag: latest

    PostgreSQL 镜像的值示例

    upstream:
      postgresql:
        image:
          registry: ""
          repository: postgresql-15
          tag: latest

  9. 使用 Helm Chart 安装 Red Hat Developer Hub。

法律通告

Copyright © 2025 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部