Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7200a92

Browse files
Fortune-Ndlovulinfrazerm3l
authoredFeb 27, 2025··
Update the Helm procedure to use oc-mirror for air-gapped OCP environments (redhat-developer#868)
* fix: Update the Helm procedure to use oc-mirror for air-gapped OCP environments Co-authored-by: Lindsey Frazier <lfrazier@redhat.com> Co-authored-by: Armel Soro <asoro@redhat.com> * Update modules/installation/proc-install-rhdh-airgapped-environment-ocp-helm.adoc --------- Co-authored-by: Lindsey Frazier <lfrazier@redhat.com> Co-authored-by: Armel Soro <asoro@redhat.com>
1 parent 9e97a36 commit 7200a92

File tree

1 file changed

+216
-69
lines changed

1 file changed

+216
-69
lines changed
 

‎modules/installation/proc-install-rhdh-airgapped-environment-ocp-helm.adoc

+216-69
Original file line numberDiff line numberDiff line change
@@ -2,137 +2,284 @@
22
// no assembly
33

44
[id="proc-install-rhdh-airgapped-environment-ocp-helm_{context}"]
5-
= Installing {product} in an air-gapped environment with the Helm Chart
5+
= Installing {product} on {ocp-short} in an air-gapped environment with the Helm chart
66

7-
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.
7+
You can install {product} in a fully disconnected or partially disconnected environment using the {product} Helm chart.
88

9-
You can install {product} in an air-gapped environment to ensure security and meet specific regulatory requirements.
9+
[role="_additional-resources"]
10+
.Additional resources
11+
* For more information about registry authentication, see https://access.redhat.com/RegistryAuthentication[{company-name} Container Registry Authentication].
1012

11-
To install {product-short} in an air-gapped environment, you must have access to the `registry.redhat.io` and the registry for the air-gapped environment.
13+
== Installing {product} on {ocp-short} in a partially disconnected environment with the Helm chart
14+
15+
If your network has access to the `registry.redhat.io` registry and the `charts.openshift.io` Helm chart repository, you can deploy your {product} instance in your partially disconnected environment by mirroring the specified resources directly to the target registry.
1216

1317
.Prerequisites
1418

15-
* You have installed an {ocp-brand-name} {ocp-version-min} or later.
19+
* You have installed {ocp-brand-name} {ocp-version-min} or later.
20+
* You have access to the `charts.openshift.io` Helm chart repository.
1621
* You have access to the `registry.redhat.io`.
17-
* You have access to the {ocp-brand-name} image registry of your cluster. For more information about exposing the image registry, see the {ocp-brand-name} documentation about https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html-single/registry/index#securing-exposing-registry[Exposing the registry].
22+
* You have access to a mirror registry that can be reached from the disconnected cluster, for example, the {ocp-short} image registry. For more information about exposing the {ocp-short} image registry, see https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html-single/registry/index#securing-exposing-registry[Exposing the registry].
23+
* You are logged in to your target mirror registry and have permissions to push images to it. For more information, see link:https://docs.openshift.com/container-platform/4.17/disconnected/mirroring/installing-mirroring-disconnected.html#installation-adding-registry-pull-secret_installing-mirroring-disconnected[Configuring credentials that allow images to be mirrored].
1824
* You have installed the {openshift-cli} on your workstation.
19-
* You have installed the `podman` command line tools on your workstation.
20-
* You you have an account in https://developers.redhat.com/[{rhdeveloper-name}] portal.
25+
* You have installed the oc-mirror {openshift-cli} plugin, for more information see https://docs.openshift.com/container-platform/4.17/disconnected/mirroring/installing-mirroring-disconnected.html#installation-oc-mirror-installing-plugin_installing-mirroring-disconnected[Installing the oc-mirror OpenShift CLI plugin].
26+
* You have an account in https://developers.redhat.com/[{rhdeveloper-name}] portal.
2127

2228
.Procedure
23-
24-
. Log in to your {ocp-short} account using the {openshift-cli}, by running the following command:
29+
. Log in to your {ocp-short} account using the {openshift-cli} by running the following command:
2530
+
26-
[source,terminal]
31+
[source,terminal,subs="attributes+"]
2732
----
2833
oc login -u <user> -p <password> https://api.<hostname>:6443
2934
----
3035

31-
. Log in to the {ocp-short} image registry using the `podman` command line tool, by running the following command:
36+
. From your disconnected cluster, log in to the image registry that you want to mirror, for example, the {ocp-short} image registry.
37+
. Create an `ImageSetConfiguration.yaml` file.
38+
. In your `ImageSetConfiguration.yaml` file, specify the resources that you want to mirror. For example:
3239
+
33-
[source,terminal]
40+
[source,terminal,subs="+quotes"]
3441
----
35-
podman login -u kubeadmin -p $(oc whoami -t) default-route-openshift-image-registry.<hostname>
42+
apiVersion: mirror.openshift.io/v1alpha2
43+
kind: ImageSetConfiguration
44+
mirror:
45+
helm:
46+
repositories:
47+
- name: _<repository_name>_ (1)
48+
url: _<repository_url>_ (2)
49+
charts:
50+
- name: _<chart_name>_ (3)
51+
version: "_<rhdh_version>_" (4)
3652
----
37-
+
38-
[NOTE]
39-
====
40-
You can run the following commands to get the full host name of the {ocp-short} image registry, and then use the host name in a command to log in:
53+
<1> The name of the repository containing the Helm chart that you want to mirror, for example, `openshift-charts`.
54+
<2> The URL for the repository containing the Helm chart that you want to mirror, for example, `https://charts.openshift.io`.
55+
<3> The name of the Helm chart containing the images that you want to mirror, for example, `redhat-developer-hub`.
56+
<4> The {product} version that you want to use, for example, `{product-version}`
4157

42-
[source,terminal]
58+
. Mirror the resources specified in the image set configuration file directly to the target registry by running the `oc-mirror` command. For example:
59+
+
60+
[source,terminal,subs="+quotes"]
4361
----
44-
REGISTRY_HOST=$(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')
62+
oc-mirror --config=_<mirror_config_directory>_/ImageSetConfiguration.yaml _<target-mirror-registry>_
4563
----
64+
+
65+
--
66+
where:
4667

47-
[source,terminal]
68+
`<mirror_config_directory>` :: Specifies the location of your image set configuration file on your system, for example, `.user`.
69+
70+
`<target_mirror_registry>` :: Specifies the location and name of your target mirror registry, for example,`docker://registry.example:5000`.
71+
--
72+
+
73+
[NOTE]
74+
====
75+
Running the `oc-mirror` command creates a local workspace containing the Helm chart and a `ImageContentSourcePolicy` (ICSP) manifest. The ICSP manifest contains an automatically-generated `imageContentSourcePolicy.yaml` file that you must apply against the cluster in a later step.
76+
====
77+
+
78+
.Example output
79+
[source,terminal,subs="+quotes"]
4880
----
49-
podman login -u kubeadmin -p $(oc whoami -t) $REGISTRY_HOST
81+
Writing image mapping to oc-mirror-workspace/results-1738070846/mapping.txt
82+
Writing ICSP manifests to oc-mirror-workspace/results-1738070846
5083
----
51-
====
52-
53-
. Log in to the `registry.redhat.io` in `podman` by running the following command:
5484
+
55-
[source,terminal]
85+
. In your workspace, locate the `imageContentSourcePolicy.yaml` file by running the `ls` command. For example:
86+
+
87+
[source,terminal,subs="+quotes"]
5688
----
57-
podman login registry.redhat.io
89+
ls _<workspace_directory>_/_<results_directory>_
5890
----
5991
+
60-
For more information about registry authentication, see https://access.redhat.com/RegistryAuthentication[{company-name} Container Registry Authentication].
92+
--
93+
where:
94+
95+
`<workspace_directory>` :: Specifies the name of your workspace directory, for example, `oc-mirror-workspace`.
6196

62-
. Pull {product-short} and PostgreSQL images from https://catalog.redhat.com/software/containers/search[{company-name} Image registry] to your workstation, by running the following commands:
97+
`<results_directory>` :: Specifies the name of your results directory, for example, `results-1738070846`.
98+
--
99+
+
100+
. To mirror the Helm chart, deploy the `imageContentSourcePolicy.yaml` file in the disconnected cluster by running the `oc apply` command. For example:
63101
+
64-
[source,terminal,source,subs="attributes+"]
102+
[source,terminal,subs="+quotes"]
65103
----
66-
podman pull registry.redhat.io/rhdh/rhdh-hub-rhel9:{product-version}
104+
oc apply -f _<workspace_directory>_/_<results_directory>_/`ImageContentSourcePolicy.yaml`
67105
----
68106
+
69-
[source,terminal,source,subs="attributes+"]
107+
--
108+
where:
109+
110+
`<workspace_directory>` :: Specifies the name of your workspace directory, for example, `oc-mirror-workspace`.
111+
112+
`<results_directory>` :: Specifies the name of your results directory, for example, `results-1738070846`.
113+
--
114+
. In your air-gapped environment, deploy the Helm chart to the namespace that you want to use by running the `helm install` command with `namespace` and `set` options. For example:
115+
+
116+
[source,terminal,subs="+quotes"]
70117
----
71-
podman pull registry.redhat.io/rhel9/postgresql-15:latest
118+
CLUSTER_ROUTER_BASE=$(oc get route console -n openshift-console -o=jsonpath='{.spec.host}' | sed 's/^[^.]*\.//')
119+
120+
helm install _<rhdh_instance>_ _<workspace_directory>_/_<results_directory>_/charts/_<archive_file>_ --namespace _<your_namespace>_ --create-namespace \
121+
--set global.clusterRouterBase="$CLUSTER_ROUTER_BASE"
72122
----
123+
+
124+
--
125+
where:
126+
127+
`<rhdh_instance>` :: Specifies the name of your {product} instance, for example, `my-rhdh`.
128+
129+
`<workspace_directory>` :: Specifies the name of your workspace directory, for example, `oc-mirror-workspace`.
130+
131+
`<results_directory>` :: Specifies the name of your results directory, for example, `results-1738070846`.
132+
133+
`<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`.
134+
135+
`<your_namespace>` :: Specifies the namespace that you want to deploy the Helm chart to, for example, `{my-product-namespace}`.
136+
--
137+
138+
== Installing {product} on {ocp-short} in a fully disconnected environment with the Helm chart
139+
140+
If your network has access to the registry through a bastion host, you can use the Helm chart to install {product} by mirroring specified resources to disk and transferring them to your air-gapped environment without any connection to the internet.
141+
142+
.Prerequisites
73143

74-
. Push both images to the internal {ocp-short} image registry by running the following commands:
144+
* You have set up your workstation.
145+
** You have access to the registry.redhat.io.
146+
** You have access to the charts.openshift.io Helm chart repository.
147+
** You have installed the {openshift-cli} on your workstation.
148+
** You have installed the oc-mirror {openshift-cli} plugin, for more information see https://docs.openshift.com/container-platform/4.17/disconnected/mirroring/installing-mirroring-disconnected.html#installation-oc-mirror-installing-plugin_installing-mirroring-disconnected[Installing the oc-mirror OpenShift CLI plugin].
149+
** You have an account in https://developers.redhat.com/[{rhdeveloper-name}] portal.
150+
* You have set up your intermediary host.
151+
** Your host has access to the disconnected cluster and to the target mirror registry, for example, the {ocp-brand-name} image registry. For more information about exposing the {ocp-short} image registry, see https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html-single/registry/index#securing-exposing-registry[Exposing the registry].
152+
** You have installed the oc-mirror {openshift-cli} plugin, for more information see https://docs.openshift.com/container-platform/4.17/disconnected/mirroring/installing-mirroring-disconnected.html#installation-oc-mirror-installing-plugin_installing-mirroring-disconnected[Installing the oc-mirror OpenShift CLI plugin].
153+
** You have installed {ocp-brand-name} {ocp-version-min} or later.
154+
** You have installed the {openshift-cli} on your workstation.
155+
156+
.Procedure
157+
. Create an `ImageSetConfiguration` file to specify the resources that you want to mirror. For example:
75158
+
76-
[source,terminal,source,subs="attributes+"]
159+
[source,terminal,subs="+quotes"]
77160
----
78-
podman push --remove-signatures registry.redhat.io/rhdh/rhdh-hub-rhel9:{product-version} default-route-openshift-image-registry.<hostname>/<project_name>/rhdh-hub-rhel9:{product-version}
161+
apiVersion: mirror.openshift.io/v1alpha2
162+
kind: ImageSetConfiguration
163+
mirror:
164+
helm:
165+
repositories:
166+
- name: _<repository_name>_ (1)
167+
url: _<repository_url>_ (2)
168+
charts:
169+
- name: _<chart_name>_ (3)
170+
version: "_<rhdh_version>_" (4)
79171
----
172+
<1> The name of the repository that you want to mirror, for example, `openshift-charts`.
173+
<2> The URL for the repository that you want to mirror, for example, `https://charts.openshift.io`.
174+
<3> The name of the Helm chart that you want to mirror, for example, `redhat-developer-hub`.
175+
<4> The version of {product} that you want to use, for example, `{product-version}`
176+
177+
. Mirror the resources specified in the `ImageSetConfiguration.yaml` file by running the `oc-mirror` command. For example:
80178
+
81-
[source,terminal]
179+
[source,terminal,subs="+quotes"]
82180
----
83-
podman push --remove-signatures registry.redhat.io/rhel9/postgresql-15:latest default-route-openshift-image-registry.<hostname>/<project_name>/postgresql-15:latest
181+
oc-mirror --config=_<mirror_config_directory>_/ImageSetConfiguration.yaml _<mirror_archive_directory>_/
84182
----
85183
+
86-
For more information about pushing images directly to the {ocp-short} image registry, see https://access.redhat.com/solutions/6959306[How do I push an Image directly into the OpenShift 4 registry].
184+
--
185+
where:
186+
187+
`<mirror_config_directory>` :: Specifies the location of your image set configuration file on your system, for example, `.user`.
188+
189+
`<mirror_configuration_file>` :: Specifies the name of your mirror configuration yaml file, for example, `mirror-config.yaml`
190+
191+
`<mirror_archive_directory>` :: Specifies the location of your directory where the mirror archive will be created, for example,`file://.user`.
192+
--
87193
+
88-
[IMPORTANT]
194+
[NOTE]
89195
====
90-
If an x509 error occurs, verify that you have link:https://access.redhat.com/solutions/6088891[installed the CA certificate used for {ocp-short} routes on your system].
196+
Running the `oc-mirror` command generates a local workspace containing the mirror archive file, the Helm chart, and a `ImageContentSourcePolicy` (ICSP) manifest. The ICSP manifest contains an `imageContentSourcePolicy.yaml` file that you must apply against the cluster in a later step.
91197
====
92-
93-
. Use the following command to verify that both images are present in the internal {ocp-short} registry:
94198
+
95-
[source,terminal,subs="+attributes"]
199+
.Example output
200+
[source,terminal,subs="+quotes"]
96201
----
97-
oc get imagestream -n {my-product-namespace}
202+
Creating archive /path/to/mirror-archive/mirror_seq1_000000.tar
98203
----
204+
+
205+
. Transfer the generated archive file (for example, `mirror_seq1_000000.tar`) to the air-gapped environment.
206+
. Connect to your air-gapped environment and make sure that you are also connected to the following objects:
207+
+
208+
* The local target registry
209+
* The target {ocp-short} cluster
210+
+
211+
. From your air-gapped environment, mirror the resources from the archive to the target registry by running the `oc-mirror` command. For example:
212+
+
213+
[source,terminal,subs="+quotes"]
214+
----
215+
oc-mirror --from _<mirror-archive-file>_ _<target-registry>_
216+
----
217+
+
218+
--
219+
where:
99220

100-
. Enable local image lookup for both images by running the following commands:
221+
`<mirror_archive_file>` :: Specifies the name of the file containing the resources that you want to mirror, for example,`mirror_seq1_0000.tar`.
222+
223+
`<target_registry>` :: Specifies the name of the target registry that you want to push the mirrored images to, for example, `docker://registry.localhost:5000`.
224+
--
101225
+
102-
[source,terminal]
226+
.Example output
227+
[source,terminal,subs="+quotes"]
103228
----
104-
oc set image-lookup postgresql-15
229+
Wrote release signatures to oc-mirror-workspace/results-1738075410
230+
Writing image mapping to oc-mirror-workspace/results-1738075410/mapping.txt
231+
Writing ICSP manifests to oc-mirror-workspace/results-1738075410
105232
----
106233
+
107-
[source,terminal]
234+
. In your workspace, locate the `imageContentSourcePolicy.yaml` file by running the `ls` command. For example:
235+
+
236+
[source,terminal,subs="+quotes"]
108237
----
109-
oc set image-lookup rhdh-hub-rhel9
238+
ls _<workspace_directory>_/_<results_directory>_
110239
----
111-
112-
. Go to *YAML view* and update the `image` section for `backstage` and `postgresql` using the following values:
113240
+
114241
--
115-
.Example values for Developer Hub image
116-
[source,yaml]
242+
where:
243+
244+
`<workspace_directory>` :: Specifies the name of your workspace directory, for example, `oc-mirror-workspace`.
245+
246+
`<results_directory>` :: Specifies the name of your results directory, for example, `results-1738070846`.
247+
--
248+
+
249+
. To mirror the Helm chart, deploy the `imageContentSourcePolicy.yaml` file in the disconnected cluster by running the `oc apply` command. For example:
250+
+
251+
[source,terminal,subs="+quotes"]
117252
----
118-
upstream:
119-
backstage:
120-
image:
121-
registry: ""
122-
repository: rhdh-hub-rhel9
123-
tag: latest
253+
oc apply -f _<workspace_directory>_/_<results_directory>_/ImageContentSourcePolicy.yaml
124254
----
255+
+
256+
--
257+
where:
258+
259+
`<workspace-directory>` :: Specifies the name of your workspace directory, for example, `oc-mirror-workspace`.
125260

126-
.Example values for PostgreSQL image
127-
[source,yaml]
261+
`<results-directory>` :: Specifies the name of your results directory, for example, `results-1738070846`.
262+
--
263+
. In your air-gapped environment, deploy the Helm chart to the namespace that you want to use by running the `helm install` command with `namespace` and `set` options. For example:
264+
+
265+
[source,terminal,subs="+quotes"]
128266
----
129-
upstream:
130-
postgresql:
131-
image:
132-
registry: ""
133-
repository: postgresql-15
134-
tag: latest
267+
CLUSTER_ROUTER_BASE=$(oc get route console -n openshift-console -o=jsonpath='{.spec.host}' | sed 's/^[^.]*\.//')
268+
269+
helm install _<rhdh_instance>_ _<workspace_directory>_/_<results_directory>_/charts/_<archive_file>_ --namespace _<your_namespace>_ --create-namespace \
270+
--set global.clusterRouterBase="$CLUSTER_ROUTER_BASE"
135271
----
272+
+
136273
--
274+
where:
275+
276+
`<rhdh_instance>` :: Specifies the name of your {product} instance, for example, `my-rhdh`.
137277

138-
. Install the {product} using Helm chart.
278+
`<workspace_directory>` :: Specifies the name of your workspace directory, for example, `oc-mirror-workspace`.
279+
280+
`<results_directory>` :: Specifies the name of your results directory, for example, `results-1738070846`.
281+
282+
`<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`.
283+
284+
`<your_namespace>` :: Specifies the namespace that you want to deploy the Helm chart to, for example, `{my-product-namespace}`.
285+
--

0 commit comments

Comments
 (0)
Please sign in to comment.