Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 3. Installing Red Hat Developer Hub on OpenShift Container Platform in an air-gapped environment with the Helm chart
You can install Red Hat Developer Hub in a fully disconnected or partially disconnected environment using the Red Hat Developer Hub Helm chart.
3.1. Installing Red Hat Developer Hub on OpenShift Container Platform in a fully disconnected environment with the Helm chart Copier lienLien copié sur presse-papiers!
If your network has access to the registry through a bastion host, you can use the Helm chart to install Red Hat Developer Hub by mirroring specified resources to disk and transferring them to your air-gapped environment without any connection to the internet.
Prerequisites
You have set up your workstation.
- You have access to the registry.redhat.io.
- You have access to the charts.openshift.io Helm chart repository.
-
You have installed the OpenShift CLI (
oc
) on your workstation. -
You have installed the oc-mirror OpenShift CLI (
oc
) plugin, for more information see Installing the oc-mirror OpenShift CLI plugin. - You have an account in Red Hat Developer portal.
You have set up your intermediary host.
- Your host has access to the disconnected cluster and to the target mirror registry, for example, the Red Hat OpenShift Container Platform image registry. For more information about exposing the OpenShift Container Platform image registry, see Exposing the registry.
-
You have installed the oc-mirror OpenShift CLI (
oc
) plugin, for more information see Installing the oc-mirror OpenShift CLI plugin. - You have installed Red Hat OpenShift Container Platform 4.14 or later.
-
You have installed the OpenShift CLI (
oc
) on your workstation.
- Make sure that your system meets the minimum sizing requirements. See Sizing requirements for Red Hat Developer Hub.
Procedure
Create an
ImageSetConfiguration
file to specify the resources that you want to mirror. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The name of the repository that you want to mirror, for example,
openshift-charts
. - The URL for the repository that you want to mirror, for example,
https://charts.openshift.io
. - The name of the Helm chart that you want to mirror, for example,
redhat-developer-hub
. - The version of Red Hat Developer Hub that you want to use, for example,
1.6
Mirror the resources specified in the
ImageSetConfiguration.yaml
file by running theoc-mirror
command. For example:oc-mirror --config=<mirror_config_directory>/ImageSetConfiguration.yaml <mirror_archive_directory>/
oc-mirror --config=<mirror_config_directory>/ImageSetConfiguration.yaml <mirror_archive_directory>/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow where:
<mirror_config_directory>
-
Specifies the location of your image set configuration file on your system, for example,
.user
. <mirror_configuration_file>
-
Specifies the name of your mirror configuration yaml file, for example,
mirror-config.yaml
<mirror_archive_directory>
-
Specifies the location of your directory where the mirror archive will be created, for example,
file://.user
.
NoteRunning the
oc-mirror
command generates a local workspace containing the mirror archive file, the Helm chart, and aImageContentSourcePolicy
(ICSP) manifest. The ICSP manifest contains animageContentSourcePolicy.yaml
file that you must apply against the cluster in a later step.Example output
Creating archive /path/to/mirror-archive/mirror_seq1_000000.tar
Creating archive /path/to/mirror-archive/mirror_seq1_000000.tar
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Transfer the generated archive file (for example,
mirror_seq1_000000.tar
) to the air-gapped environment. Connect to your air-gapped environment and make sure that you are also connected to the following objects:
- The local target registry
- The target OpenShift Container Platform cluster
From your air-gapped environment, mirror the resources from the archive to the target registry by running the
oc-mirror
command. For example:oc-mirror --from <mirror-archive-file> <target-registry>
oc-mirror --from <mirror-archive-file> <target-registry>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow where:
<mirror_archive_file>
-
Specifies the name of the file containing the resources that you want to mirror, for example,
mirror_seq1_0000.tar
. <target_registry>
-
Specifies the name of the target registry that you want to push the mirrored images to, for example,
docker://registry.localhost:5000
.
Example output
Wrote release signatures to oc-mirror-workspace/results-1738075410 Writing image mapping to oc-mirror-workspace/results-1738075410/mapping.txt Writing ICSP manifests to oc-mirror-workspace/results-1738075410
Wrote release signatures to oc-mirror-workspace/results-1738075410 Writing image mapping to oc-mirror-workspace/results-1738075410/mapping.txt Writing ICSP manifests to oc-mirror-workspace/results-1738075410
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In your workspace, locate the
imageContentSourcePolicy.yaml
file by running thels
command. For example:ls <workspace_directory>/<results_directory>
ls <workspace_directory>/<results_directory>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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 mirror the Helm chart, deploy the
imageContentSourcePolicy.yaml
file in the disconnected cluster by running theoc apply
command. For example:oc apply -f <workspace_directory>/<results_directory>/ImageContentSourcePolicy.yaml
oc apply -f <workspace_directory>/<results_directory>/ImageContentSourcePolicy.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
.
In your air-gapped environment, deploy the Helm chart to the namespace that you want to use by running the
helm install
command withnamespace
andset
options. 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"
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"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
.
3.2. Installing Red Hat Developer Hub on OpenShift Container Platform in a partially disconnected environment with the Helm chart Copier lienLien copié sur presse-papiers!
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.14 or later.
-
You have access to the
charts.openshift.io
Helm 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. -
You have installed the oc-mirror OpenShift CLI (
oc
) plugin, 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
oc login -u <user> -p <password> https://api.<hostname>:6443
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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.yaml
file. In your
ImageSetConfiguration.yaml
file, specify the resources that you want to mirror. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The name of the repository containing the Helm chart that you want to mirror, for example,
openshift-charts
. - The URL for the repository containing the Helm chart that you want to mirror, for example,
https://charts.openshift.io
. - The name of the Helm chart containing the images that you want to mirror, for example,
redhat-developer-hub
. - The Red Hat Developer Hub version that you want to use, for example,
1.6
Mirror the resources specified in the image set configuration file directly to the target registry by running the
oc-mirror
command. For example:oc-mirror --config=<mirror_config_directory>/ImageSetConfiguration.yaml <target-mirror-registry>
oc-mirror --config=<mirror_config_directory>/ImageSetConfiguration.yaml <target-mirror-registry>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
.
NoteRunning the
oc-mirror
command creates a local workspace containing the Helm chart and aImageContentSourcePolicy
(ICSP) manifest. The ICSP manifest contains an automatically-generatedimageContentSourcePolicy.yaml
file that you must apply against the cluster in a later step.Example output
Writing image mapping to oc-mirror-workspace/results-1738070846/mapping.txt Writing ICSP manifests to oc-mirror-workspace/results-1738070846
Writing image mapping to oc-mirror-workspace/results-1738070846/mapping.txt Writing ICSP manifests to oc-mirror-workspace/results-1738070846
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In your workspace, locate the
imageContentSourcePolicy.yaml
file by running thels
command. For example:ls <workspace_directory>/<results_directory>
ls <workspace_directory>/<results_directory>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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 mirror the Helm chart, deploy the
imageContentSourcePolicy.yaml
file in the disconnected cluster by running theoc apply
command. For example:oc apply -f <workspace_directory>/<results_directory>/ImageContentSourcePolicy.yaml
oc apply -f <workspace_directory>/<results_directory>/ImageContentSourcePolicy.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
.
In your air-gapped environment, deploy the Helm chart to the namespace that you want to use by running the
helm install
command withnamespace
andset
options. 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"
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"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
.