Installing Red Hat Developer Hub in an air-gapped environment
Running Red Hat Developer Hub on Red Hat OpenShift Container Platform in a networik restricted environment by using either the Operator or Helm chart.
Abstract
1. Air-gapped environment
An air-gapped environment, also known as an air-gapped network or isolated network, ensures security by physically segregating the system or network. This isolation is established to prevent unauthorized access, data transfer, or communication between the air-gapped system and external sources.
You can install the Red Hat Developer Hub in an air-gapped environment to ensure security and meet specific regulatory requirements.
2. Installing Red Hat Developer Hub in an air-gapped environment with the Operator
You can install Red Hat Developer Hub in a fully disconnected or partially disconnected environment using the Red Hat Developer Hub Operator. For a list of supported platforms, see the Red Hat Developer Hub Life Cycle page.
2.1. Installing Red Hat Developer Hub in a partially disconnected environment with the Operator
On an OpenShift Container Platform cluster operating on a restricted network, public resources are not available. However, deploying the Red Hat Developer Hub Operator and running Developer Hub requires the following public resources:
- Operator images (bundle, operator, catalog)
- Operands images (RHDH, PostgreSQL)
To make these resources available, replace them with their equivalent resources in a mirror registry accessible to your cluster.
You can use a helper script that mirrors the necessary images and provides the necessary configuration to ensure those images will be used when installing the Red Hat Developer Hub Operator and creating Developer Hub instances. This script requires a target mirror registry. You likely have a target mirror registry ready to use if your cluster is already operating on a disconnected network. If you do not already have a target registry, and if you have an OpenShift Container Platform cluster, you might want to expose and leverage the internal cluster registry.
If you are connected to a OpenShift Container Platform cluster, the helper script will detect it and will automatically expose the cluster registry. However, if you are connected to a Kubernetes cluster, you can manually specify the target registry that you want to mirror the images to.
Prerequisites
- You have installed Podman 5.3 or later. For more information, see Podman Installation Instructions.
- You have installed Skopeo 1.17 or later.
- You have installed yq 4.44 or later.
- You have installed the GNU sed command line text editor.
- You have installed umoci CLI tool.
-
You have an active
oc registry
,podman
, orskopeo
session to theregistry.redhat.io
Red Hat Ecosystem Catalog. For more information, see Red Hat Container Registry Authentication. -
You have an active
skopeo
session with administrative access to the target mirror registry. For more information, see Authenticating to a registry. -
You have installed the
opm
CLI tool. For more information, see Installing the opm CLI. If you are using an OpenShift Container Platform cluster, you have the following prerequisites:
-
(Optional) You have installed the
oc-mirror
OpenShift Container Platform CLI plugin if you want to use it to mirror images.
-
(Optional) You have installed the
If you are using a supported Kubernetes cluster, you have the following prerequisites:
- You have installed the Operator Lifecycle Manager (OLM) on the disconnected cluster.
- You have a mirror registry that is reachable from the disconnected cluster.
Procedure
- In your terminal, navigate to the directory where you want to save the mirroring script.
Download the mirroring script by running the following command:
curl -sSLO https://raw.githubusercontent.com/redhat-developer/rhdh-operator/refs/heads/release-1.5/.rhdh/scripts/prepare-restricted-environment.sh
Run the mirroring script by running the
bash
command with the appropriate set of options:bash prepare-restricted-environment.sh \ (1) [--to-registry <my.registry.example.com>]] \ (2) [--use-oc-mirror true]
- Specifies the URL for the target mirror registry where you want to mirror the images.
- (Optional) Uses the
oc-mirror
OpenShift Container Platform CLI plugin to mirror images.
NoteThe script can take several minutes to complete as it copies multiple images to the mirror registry.
Verification
- If you are using Red Hat OpenShift Container Platform, the Red Hat Developer Hub Operator is in the Installed Operators list in the web console.
If you are using a supported Kubernetes platform, you can check the list of pods running in the
rhdh-operator
namespace by running the following command in your terminal:kubectl -n rhdh-operator get pods
2.2. Installing Red Hat Developer Hub in a fully disconnected environment with the Operator
If your network has access to the registry through a bastion host, you can use the helper script to install Red Hat Developer Hub by mirroring the Operator-related images to disk and transferring them to your air-gapped environment without any connection to the internet.
Prerequisites
- You have installed Podman 5.3 or later. For more information, see Podman Installation Instructions.
- You have installed Skopeo 1.17 or later.
- You have installed yq 4.44 or later.
- You have installed the GNU sed command line text editor.
- You have installed umoci CLI tool.
-
You have an active
oc registry
,podman
, orskopeo
session to theregistry.redhat.io
Red Hat Ecosystem Catalog. For more information, see Red Hat Container Registry Authentication. -
You have an active
oc registry
session to theregistry.redhat.io
Red Hat Ecosystem Catalog. For more information, see Red Hat Container Registry Authentication. -
You have installed the
opm
CLI tool. For more information, see Installing the opm CLI. - You have installed Podman 5.3 or later. For more information, see Podman Installation Instructions.
Procedure
Download the mirroring script to disk by running the following command:
curl -sSLO https://raw.githubusercontent.com/redhat-developer/rhdh-operator/refs/heads/release-1.5/.rhdh/scripts/prepare-restricted-environment.sh
Run the mirroring script by running the
bash
command with the appropriate set of options:bash prepare-restricted-environment.sh \ --to-dir <my_pulled_image_location>
where
- <my_pulled_image_location>
Specifies the absolute path to a directory where you want to pull all of the necessary images with the
--to-dir
option, for example,/home/user/rhdh-operator-mirror-dir
.NoteThe script can take several minutes to complete as it copies multiple images to the mirror registry.
-
Transfer the directory specified by the
--to-dir
option to your disconnected environment. From a machine in your disconnected environment that has access to both the cluster and the target mirror registry, run the mirroring script by running the
bash
command with the appropriate set of options:bash <my_pulled_image_location>/install.sh \ (1) --from-dir <my_pulled_image_location> \ (2) [--to-registry <my.registry.example.com>] \ (3) [--use-oc-mirror true] (4)
- The downloaded image and the absolute path to the directory where it is stored on your system.
- Specifies the directory where you want to pull all of the necessary images with the
--to-dir
option. - Specifies the URL for the target mirror registry where you want to mirror the images.
- (Optional) Uses the
oc-mirror
OpenShift Container Platform CLI plugin to mirror images.
NoteIf you used
oc-mirror
to mirror the images to disk, you must also useoc-mirror
to mirror the images from disk due to the folder layout thatoc-mirror
uses.NoteThe script can take several minutes to complete as it automatically installs the Red Hat Developer Hub Operator.
Verification
- If you are using Red Hat OpenShift Container Platform, the Red Hat Developer Hub Operator is in the Installed Operators list in the web console.
If you are using a supported Kubernetes platform, you can check the list of pods running in the
rhdh-operator
namespace by running the following command in your terminal:kubectl -n rhdh-operator get pods
Next steps
- To deploy RHDH on Red Hat OpenShift Container Platform with the Operator, see Installing Red Hat Developer Hub on OpenShift Container Platform with the Operator
- To deploy RHDH on Amazon Elastic Kubernetes Service with the Operator, see Installing Developer Hub on EKS with the Operator
- To deploy RHDH on Microsoft Azure Kubernetes Service with the Operator, see Installing Developer Hub on AKS with the Operator
- To deploy RHDH on Google Cloud Platform with the Operator, see Installing Developer Hub on GCP with the Operator
- To deploy RHDH on Google Kubernetes Engine with the Operator, see Deploying Developer Hub on GKE with the Operator
3. Installing Red Hat Developer Hub in an air-gapped environment with the Helm Chart
An air-gapped environment, also known as an air-gapped network or isolated network, ensures security by physically segregating the system or network. This isolation is established to prevent unauthorized access, data transfer, or communication between the air-gapped system and external sources.
You can install Red Hat Developer Hub in an air-gapped environment to ensure security and meet specific regulatory requirements.
To install Developer Hub in an air-gapped environment, you must have access to the registry.redhat.io
and the registry for the air-gapped environment.
Prerequisites
- You have installed an Red Hat OpenShift Container Platform 4.14 or later.
-
You have access to the
registry.redhat.io
. - You have access to the Red Hat OpenShift Container Platform image registry of your cluster. For more information about exposing the image registry, see the Red Hat OpenShift Container Platform documentation about Exposing the registry.
-
You have installed the OpenShift CLI (
oc
) on your workstation. -
You have installed the
podman
command line tools on your workstation. - You you have an account in Red Hat Developer portal.
Procedure
Log in to your OpenShift Container Platform account using the OpenShift CLI (
oc
), by running the following command:oc login -u <user> -p <password> https://api.<hostname>:6443
Log in to the OpenShift Container Platform image registry using the
podman
command line tool, by running the following command:podman login -u kubeadmin -p $(oc whoami -t) default-route-openshift-image-registry.<hostname>
NoteYou can run the following commands to get the full host name of the OpenShift Container Platform image registry, and then use the host name in a command to log in:
REGISTRY_HOST=$(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')
podman login -u kubeadmin -p $(oc whoami -t) $REGISTRY_HOST
Log in to the
registry.redhat.io
inpodman
by running the following command:podman login registry.redhat.io
For more information about registry authentication, see Red Hat Container Registry Authentication.
Pull Developer Hub and PostgreSQL images from Red Hat Image registry to your workstation, by running the following commands:
podman pull registry.redhat.io/rhdh/rhdh-hub-rhel9:1.5
podman pull registry.redhat.io/rhel9/postgresql-15:latest
Push both images to the internal OpenShift Container Platform image registry by running the following commands:
podman push --remove-signatures registry.redhat.io/rhdh/rhdh-hub-rhel9:1.5 default-route-openshift-image-registry.<hostname>/<project_name>/rhdh-hub-rhel9:1.5
podman push --remove-signatures registry.redhat.io/rhel9/postgresql-15:latest default-route-openshift-image-registry.<hostname>/<project_name>/postgresql-15:latest
For more information about pushing images directly to the OpenShift Container Platform image registry, see How do I push an Image directly into the OpenShift 4 registry.
ImportantIf an x509 error occurs, verify that you have installed the CA certificate used for OpenShift Container Platform routes on your system.
Use the following command to verify that both images are present in the internal OpenShift Container Platform registry:
oc get imagestream -n {my-product-namespace}
Enable local image lookup for both images by running the following commands:
oc set image-lookup postgresql-15
oc set image-lookup rhdh-hub-rhel9
Go to YAML view and update the
image
section forbackstage
andpostgresql
using the following values:Example values for Developer Hub image
upstream: backstage: image: registry: "" repository: rhdh-hub-rhel9 tag: latest
Example values for PostgreSQL image
upstream: postgresql: image: registry: "" repository: postgresql-15 tag: latest
- Install the Red Hat Developer Hub using Helm chart.