3.2. Installing Red Hat Developer Hub on OpenShift Container Platform in a partially disconnected environment with the Helm chart
If your network has access to the registry.redhat.io registry and the charts.openshift.io Helm chart repository, you can deploy your Red Hat Developer Hub instance in your partially disconnected environment by mirroring the specified resources directly to the target registry.
Prerequisites
- You have installed Red Hat OpenShift Container Platform 4.16 or later.
-
You have access to the
charts.openshift.ioHelm chart repository. -
You have access to the
registry.redhat.io. - You have access to a mirror registry that can be reached from the disconnected cluster, for example, the OpenShift Container Platform image registry. For more information about exposing the OpenShift Container Platform image registry, see Exposing the registry.
- You are logged in to your target mirror registry and have permissions to push images to it. For more information, see Configuring credentials that allow images to be mirrored.
-
You have installed the OpenShift CLI (
oc) on your workstation. -
Recommended on OpenShift Container Platform: You have installed the
oc-mirrorOpenShift CLI (oc) plugin v2. For more information, see Installing the oc-mirror OpenShift CLI plugin. - You have an account in Red Hat Developer portal.
- Make sure that your system meets the minimum sizing requirements. See Sizing requirements for Red Hat Developer Hub.
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- From your disconnected cluster, log in to the image registry that you want to mirror, for example, the OpenShift Container Platform image registry.
Create an
ImageSetConfiguration.yamlfile to specify the resources that you want to mirror. For example:apiVersion: mirror.openshift.io/v2alpha1 kind: ImageSetConfiguration mirror: helm: repositories: - name: openshift-charts url: https://charts.openshift.io charts: - name: redhat-developer-hub version: "1.7"version: "1.7"- Enter the Red Hat Developer Hub version to mirror.
Mirror the resources specified in the image set configuration file directly to the target registry by running the
oc-mirrorcommand. For example:oc-mirror --config=<mirror_config_directory>/ImageSetConfiguration.yaml <target-mirror-registry>where:
<mirror_config_directory>-
Specifies the location of your image set configuration file on your system, for example,
.user. <target_mirror_registry>-
Specifies the location and name of your target mirror registry, for example,
docker://registry.example:5000.
注記Running the
oc-mirrorcommand creates a local workspace containing the Helm chart and aImageContentSourcePolicy(ICSP) manifest. The ICSP manifest contains an automatically-generatedimageContentSourcePolicy.yamlfile that you must apply against the cluster in a later step.In your workspace, locate the
ImageDigestMirrorSet(IDMS) andImageTagMirrorSet(ITMS) files by running thelscommand. For example:ls <workspace_directory>/working-dir/cluster-resources/where:
<workspace_directory>-
Specifies the name of your workspace directory, for example,
oc-mirror-workspace. <results_directory>-
Specifies the name of your results directory, for example,
results-1738070846.
To configure image mirroring, deploy the IDMS and ITMS files in the disconnected cluster by running the
ocapply command. For example:oc apply -f <workspace_directory>/working-dir/cluster-resourceswhere:
<workspace_directory>-
Enter the name of your workspace directory, for example,
oc-mirror-workspace. <results_directory>-
Enter the name of your results directory, for example,
results-1738070846.
In your air-gapped environment, deploy the Helm chart to the namespace that you want to use by running the
helm installcommand withnamespaceandsetoptions. For example:CLUSTER_ROUTER_BASE=$(oc get route console -n openshift-console -o=jsonpath='{.spec.host}' | sed 's/[.]*\.//') helm install <rhdh_instance> <workspace_directory>/<results_directory>/charts/<archive_file> --namespace <your_namespace> --create-namespace \ --set global.clusterRouterBase="$CLUSTER_ROUTER_BASE"where:
<rhdh_instance>-
Specifies the name of your Red Hat Developer Hub instance, for example,
my-rhdh. <workspace_directory>-
Specifies the name of your workspace directory, for example,
oc-mirror-workspace. <results_directory>-
Specifies the name of your results directory, for example,
results-1738070846. <archive_file>-
Specifies the name of the archive file containing the resources that you want to mirror, for example,
redhat-developer-hub-1.4.1.tgz. <your_namespace>-
Specifies the namespace that you want to deploy the Helm chart to, for example,
my-rhdh-project.