Skip to content

Commit b8a4a26

Browse files
committed
RHIDP-5494: Doc air-gapped installation using Operator
1 parent 95876ff commit b8a4a26

File tree

1 file changed

+128
-37
lines changed

1 file changed

+128
-37
lines changed

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

Lines changed: 128 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,68 +5,159 @@
55
[id="proc-install-rhdh-airgapped-environment-ocp-operator_{context}"]
66
= Installing {product} in an air-gapped environment with the Operator
77

8+
You can install {product} in a fully disconnected or partially disconnected environment using the {product} Operator. For a list of supported platforms, see the link:https://access.redhat.com/support/policy/updates/developerhub[{product} Life Cycle page].
9+
10+
== Installing {product} on {ocp-short} in a partially disconnected environment with the Operator
11+
812
On an {ocp-short} cluster operating on a restricted network, public resources are not available. However, deploying the {product} Operator and running {product-short} requires the following public resources:
913

1014
* Operator images (bundle, operator, catalog)
1115
* Operands images ({product-very-short}, PostgreSQL)
1216

13-
To make these resources available, replace them with their equivalent resources in a mirror registry accessible to the {ocp-short} cluster.
17+
To make these resources available, replace them with their equivalent resources in a mirror registry accessible to your cluster.
1418

15-
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 {product} Operator and creating {product-short} instances.
19+
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 {product} Operator and creating {product-short} 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 {ocp-short} cluster, you might want to expose and leverage the internal cluster registry.
1620

17-
[NOTE]
18-
====
19-
This script requires a target mirror registry which you should already have installed if your {ocp-short} cluster is ready to operate on a restricted network. However, if you are preparing your cluster for disconnected usage, you can use the script to deploy a mirror registry in the cluster and use it for the mirroring process.
20-
====
21+
If you are connected to a {ocp-short} 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.
2122

2223
.Prerequisites
23-
* You have an active {openshift-cli} session with administrative permissions to the {ocp-short} cluster. See link:https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html-single/cli_tools/index#cli-getting-started[Getting started with the OpenShift CLI].
24-
* You have an active `oc registry` session to the `registry.redhat.io` {company-name} Ecosystem Catalog. See link:https://access.redhat.com/RegistryAuthentication[{company-name} Container Registry Authentication].
25-
* The `opm` CLI tool is installed. See link:https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html-single/cli_tools/index#olm-about-opm_cli-opm-install[Installing the opm CLI].
26-
* The jq package is installed. See link:https://jqlang.github.io/jq/download/[Download jq].
27-
* Podman is installed. See link:https://podman.io/docs/installation[Podman Installation Instructions].
28-
* Skopeo version 1.14 or higher is installed. link:https://github.com/containers/skopeo/blob/main/install.md[See Installing Skopeo].
29-
* If you already have a mirror registry for your cluster, an active Skopeo session with administrative access to this registry is required. See link:https://github.com/containers/skopeo#authenticating-to-a-registry[Authenticating to a registry] and link:https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html-single/disconnected_installation_mirroring/index#prerequisites_installing-mirroring-installation-images[Mirroring images for a disconnected installation].
30-
31-
[NOTE]
32-
====
33-
The internal {ocp-short} cluster image registry cannot be used as a target mirror registry. See link:https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html-single/disconnected_installation_mirroring/index#installation-about-mirror-registry_installing-mirroring-installation-images[About the mirror registry].
34-
====
35-
36-
* If you prefer to create your own mirror registry, see link:https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html-single/disconnected_installation_mirroring/index#installing-mirroring-creating-registry[Creating a mirror registry with mirror registry for Red Hat OpenShift].
37-
38-
* If you do not already have a mirror registry, you can use the helper script to create one for you and you need the following additional prerequisites:
39-
+
40-
** The cURL package is installed. For {rhel}, the curl command is available by installing the curl package. To use curl for other platforms, see the link:https://curl.se/[cURL website].
41-
** The `htpasswd` command is available. For {rhel}, the `htpasswd` command is available by installing the `httpd-tools` package.
24+
* You have an active `oc registry` session to the `registry.redhat.io` {company-name} Ecosystem Catalog. For more information, see link:https://access.redhat.com/RegistryAuthentication[{company-name} Container Registry Authentication].
25+
* You have an active `skopeo` session with administrative access to the target mirror registry. For more information, see link:https://github.com/containers/skopeo#authenticating-to-a-registry[Authenticating to a registry].
26+
* You have installed the `opm` CLI tool. For more information, see link:https://docs.redhat.com/en/documentation/openshift_container_platform/4.17/html/cli_tools/opm-cli#olm-about-opm_cli-opm-install[Installing the opm CLI].
27+
* You have installed Podman 5.3 or later. For more information, see link:https://podman.io/docs/installation[Podman Installation Instructions].
4228

4329
.Procedure
44-
. Download and run the mirroring script to install a custom Operator catalog and mirror the related images: `prepare-restricted-environment.sh` (link:https://github.com/redhat-developer/rhdh-operator/blob/release-{product-version}/.rhdh/scripts/prepare-restricted-environment.sh[source]).
30+
. In your terminal, navigate to the directory where you want to save the mirroring script.
31+
. Download the mirroring script by running the following command:
4532
+
46-
[source,yaml,subs="attributes+"]
33+
[source,terminal,subs="attributes+"]
34+
----
35+
curl -sSLO https://raw.githubusercontent.com/redhat-developer/rhdh-operator/refs/heads/release-{product-version}/.rhdh/scripts/prepare-restricted-environment.sh
36+
----
37+
+
38+
. Run the mirroring script by running the `bash` command with the appropriate set of options:
39+
* If you do not already have a target mirror registry and want the script to create one for you, use the following example:
40+
+
41+
[source,terminal,subs="+quotes,+attributes"]
4742
----
48-
curl -sSLO https://raw.githubusercontent.com/redhat-developer/rhdh-operator/{product-version}.x/.rhdh/scripts/prepare-restricted-environment.sh
49-
50-
# if you do not already have a target mirror registry
51-
# and want the script to create one for you
52-
# use the following example:
5343
bash prepare-restricted-environment.sh \
5444
--prod_operator_index "registry.redhat.io/redhat/redhat-operator-index:v{ocp-version}" \
5545
--prod_operator_package_name "rhdh" \
5646
--prod_operator_bundle_name "rhdh-operator" \
57-
--prod_operator_version "v{product-bundle-version}"
58-
59-
# if you already have a target mirror registry
60-
# use the following example:
47+
--prod_operator_version "v{product-bundle-version}" \
48+
----
49+
* If you want to use an existing target mirror registry, specify it with the `--use_existing_mirror_registry` option. For example:
50+
+
51+
[source,terminal,subs="+quotes,+attributes"]
52+
----
6153
bash prepare-restricted-environment.sh \
6254
--prod_operator_index "registry.redhat.io/redhat/redhat-operator-index:v{ocp-version}" \
6355
--prod_operator_package_name "rhdh" \
6456
--prod_operator_bundle_name "rhdh-operator" \
6557
--prod_operator_version "v{product-bundle-version}" \
66-
--use_existing_mirror_registry "my_registry"
58+
--use_existing_mirror_registry "_<my_registry>_"
6759
----
6860
+
6961
[NOTE]
7062
====
7163
The script can take several minutes to complete as it copies multiple images to the mirror registry.
7264
====
65+
66+
.Verification
67+
* If you are using {ocp-brand-name}, the {product} Operator is in the *Installed Operators* list in the web console.
68+
* 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:
69+
+
70+
[source,terminal,subs="+quotes,+attributes"]
71+
----
72+
kubectl -n rhdh-operator get pods
73+
----
74+
75+
== Installing {product} on {ocp-short} in a fully disconnected environment with the Operator
76+
77+
If your network has access to the registry through a bastion host or physical disk, you can use the Operator to install {product} by mirroring specified resources and transferring them to your air-gapped environment without any connection to the internet.
78+
79+
.Prerequisites
80+
81+
* You have set up your disconnected environment.
82+
** You have mirrored all of the required images to disk.
83+
** You have manually transferred the mirror folder to the network of the disconnected mirror registry.
84+
** You have mirrored the images from disk to the target mirror registry in your disconnected environment.
85+
** You have installed the Operator in your disconnected environment.
86+
* You have set up your workstation.
87+
** You have an active `oc registry` session to the `registry.redhat.io` {company-name} Ecosystem Catalog. For more information, see link:https://access.redhat.com/RegistryAuthentication[{company-name} Container Registry Authentication].
88+
** You have installed the `opm` CLI tool. For more information, see link:https://docs.redhat.com/en/documentation/openshift_container_platform/4.17/html/cli_tools/opm-cli#olm-about-opm_cli-opm-install[Installing the opm CLI].
89+
** You have installed Podman 5.3 or later. For more information, see link:https://podman.io/docs/installation[Podman Installation Instructions].
90+
91+
.Procedure
92+
. Download the mirroring script to disk by running the following command:
93+
+
94+
[source,terminal,subs="attributes+"]
95+
----
96+
curl -sSLO https://raw.githubusercontent.com/redhat-developer/rhdh-operator/refs/heads/release-{product-version}/.rhdh/scripts/prepare-restricted-environment.sh
97+
----
98+
+
99+
. Run the mirroring script by running the `bash` command with the appropriate set of options:
100+
+
101+
[source,terminal,subs="+quotes,+attributes"]
102+
----
103+
bash prepare-restricted-environment.sh \
104+
--index-image "quay.io/rhdh/iib:next-v4.18-x86_64" \
105+
--ci-index true \
106+
--to-dir _<my_pulled_image_location>_ \
107+
[--filter-versions '*'] \
108+
[--use-oc-mirror true]
109+
----
110+
+
111+
where
112+
113+
_<my_pulled_image_location>_ :: Specifies the directory where you want to pull all of the necessary images with the `--to-dir` option, for example, my.registry.example.com/namespace
114+
+
115+
[NOTE]
116+
====
117+
The script can take several minutes to complete as it copies multiple images to the mirror registry.
118+
====
119+
+
120+
. Transfer the directory specified by the `--to-dir` option to your disconnected environment.
121+
. From a machine in your disconnected environment that has access to both the cluster and the target mirror registry, download the mirroring script from disk by running the following command:
122+
+
123+
[source,terminal,subs="attributes+"]
124+
----
125+
curl -sSLO https://raw.githubusercontent.com/redhat-developer/rhdh-operator/refs/heads/release-{product-version}/.rhdh/scripts/prepare-restricted-environment.sh
126+
----
127+
+
128+
. Run the mirroring script by running the `bash` command with the appropriate set of options:
129+
+
130+
[source,terminal,subs="+quotes,+attributes"]
131+
----
132+
bash prepare-restricted-environment.sh \
133+
--from-dir _<my_pulled_image_location>_ \
134+
[--to-registry _<my.registry.example.com>_/_<namespace>_] \
135+
[--use-oc-mirror true]
136+
----
137+
+
138+
where
139+
140+
_<my_pulled_image_location>_ :: Specifies the directory where you want to pull all of the necessary images with the `--to-dir` option.
141+
142+
_<my.registry.example.com>_ :: Specifies the URL for the target mirror registry where you want to mirror the images.
143+
144+
_<namespace>_ :: Specifies the target namespace where you want to mirror the images.
145+
+
146+
[NOTE]
147+
====
148+
If you used `oc-mirror` to mirror the images to disk, you must also use `oc-mirror` to mirror the images from disk due to the folder layout that `oc-mirror` uses.
149+
====
150+
+
151+
[NOTE]
152+
====
153+
The script can take several minutes to complete as it automatically installs the {product} Operator.
154+
====
155+
156+
.Verification
157+
* If you are using {ocp-brand-name}, the {product} Operator is in the *Installed Operators* list in the web console.
158+
* 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:
159+
+
160+
[source,terminal,subs="+quotes,+attributes"]
161+
----
162+
kubectl -n rhdh-operator get pods
163+
----

0 commit comments

Comments
 (0)