Skip to content

Commit 20ac277

Browse files
openshift-cherrypick-robotrm3ljmagakthemr0c
authored
[release-1.7] RHDHBUGS-2070 - Added oc-mirror prerequisite (#1436)
Co-authored-by: Armel Soro <armel@rm3l.org> Co-authored-by: Judith Magak <124673476+jmagak@users.noreply.github.com> Co-authored-by: Fabrice Flore-Thébault <ffloreth@redhat.com>
1 parent 23a7b31 commit 20ac277

5 files changed

+82
-73
lines changed

modules/installation/proc-install-rhdh-airgapped-partial-k8s-helm.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ In a partially disconnected environment, the cluster cannot access external regi
1717

1818
. In a terminal, download and extract the Helm chart by running the following commands:
1919
+
20-
[source,terminal,subs="attributes+"]
20+
[source,terminal,subs="+attributes,+quotes"]
2121
----
2222
helm repo add _<helm_chart_repo_name>_ https://charts.openshift.io/
2323
helm repo update
2424
helm pull _<helm_chart_repo_name>_/redhat-developer-hub --version _<rhdh_version>_
2525
helm show values _<helm_chart_repo_name>_/redhat-developer-hub --version _<rhdh_version>_ > values.default.yaml
2626
----
2727
+
28-
where
28+
where:
2929

30-
_<helm_chart_repo_name>_ :: Specifies the name of the Helm chart repository, for example, `openshift-helm-charts`.
31-
_<rhdh_version>_ :: Specifies the {product} version that you want to use, for example, `{product-chart-version}`.
30+
_<helm_chart_repo_name>_ :: Enter the name of the Helm chart repository, for example, `openshift-helm-charts`.
31+
_<rhdh_version>_ :: Enter the {product} version that you want to use, for example, `{product-chart-version}`.
3232
+
3333
. Use `yq` to extract the image digests by running the following commands:
3434
+

modules/installation/proc-install-rhdh-helm-airgapped-full.adoc

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,36 @@ If your network has access to the registry through a bastion host, you can use t
66
.Prerequisites
77

88
* You have set up your workstation.
9-
** You have access to the registry.redhat.io.
9+
** You have an account in https://developers.redhat.com/[{rhdeveloper-name}] portal.
1010
** You have access to the charts.openshift.io Helm chart repository.
1111
** You have installed the {openshift-cli} on your workstation.
12-
* {ocp-docs-link}/html-single/disconnected_environments/index#about-installing-oc-mirror-v2[You have installed the oc-mirror OpenShift CLI plugin].
13-
** You have an account in https://developers.redhat.com/[{rhdeveloper-name}] portal.
14-
** You have set up your intermediary host.
15-
** 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 {ocp-docs-link}/html-single/registry/index#securing-exposing-registry[Exposing the registry].
16-
** {ocp-docs-link}/html-single/disconnected_environments/index#about-installing-oc-mirror-v2[You have installed the oc-mirror OpenShift CLI plugin].
12+
** You have installed the {ocp-docs-link}/html-single/disconnected_environments/index#installation-oc-mirror-installing-plugin_about-installing-oc-mirror-v2[`oc-mirror`] tool, with a version corresponding to the version of your {ocp-short} cluster.
13+
* You have set up your intermediary host.
14+
** Your host has access to the link:https://registry.redhat.io[{company-name} Ecosystem Catalog].
15+
** Your host has access to image registry on the destination host.
16+
See {ocp-docs-link}/html-single/registry/index#securing-exposing-registry[Exposing the registry].
17+
* You have set up your destination host.
1718
** You have installed {ocp-brand-name} {ocp-version-min} or later.
18-
** You have installed the {openshift-cli} on your workstation.
19-
* Make sure that your system meets the minimum sizing requirements. See {about-book-link}#rhdh-sizing_about-rhdh[Sizing requirements for {product}].
19+
** Your system meets the minimum sizing requirements. See {about-book-link}#rhdh-sizing_about-rhdh[Sizing requirements for {product}].
2020

2121
.Procedure
2222
. Create an `ImageSetConfiguration` file to specify the resources that you want to mirror. For example:
2323
+
24-
[source,terminal,subs="+quotes"]
24+
[source,yaml,subs="+attributes,+quotes"]
2525
----
2626
apiVersion: mirror.openshift.io/v1alpha2
2727
kind: ImageSetConfiguration
2828
mirror:
2929
helm:
3030
repositories:
31-
- name: _<repository_name>_ (1)
32-
url: _<repository_url>_ (2)
31+
- name: openshift-charts
32+
url: https://charts.openshift.io
3333
charts:
34-
- name: _<chart_name>_ (3)
35-
version: "_<rhdh_version>_" (4)
34+
- name: redhat-developer-hub
35+
version: "{product-version}"
3636
----
37-
<1> The name of the repository that you want to mirror, for example, `openshift-charts`.
38-
<2> The URL for the repository that you want to mirror, for example, `https://charts.openshift.io`.
39-
<3> The name of the Helm chart that you want to mirror, for example, `redhat-developer-hub`.
40-
<4> The version of {product} that you want to use, for example, `{product-version}`
37+
where:
38+
`version: "{product-version}"`:: Enter the {product} version to mirror.
4139

4240
. Mirror the resources specified in the `ImageSetConfiguration.yaml` file by running the `oc-mirror` command. For example:
4341
+
@@ -49,19 +47,18 @@ oc-mirror --config=_<mirror_config_directory>_/ImageSetConfiguration.yaml _<mirr
4947
--
5048
where:
5149

52-
`<mirror_config_directory>` :: Specifies the location of your image set configuration file on your system, for example, `.user`.
50+
`<mirror_config_directory>` :: Enter the location of your image set configuration file on your system, for example, `.user`.
5351

54-
`<mirror_configuration_file>` :: Specifies the name of your mirror configuration yaml file, for example, `mirror-config.yaml`
55-
56-
`<mirror_archive_directory>` :: Specifies the location of your directory where the mirror archive will be created, for example, `pass:[file://.user]`.
52+
`<mirror_archive_directory>` :: Enter the location of your directory where the mirror archive will be created, for example, `pass:[file://.user]`.
5753
--
5854
+
5955
[NOTE]
6056
====
6157
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.
6258
====
6359
+
64-
.Example output
60+
Example output:
61+
+
6562
[source,terminal,subs="+quotes"]
6663
----
6764
Creating archive /path/to/mirror-archive/mirror_seq1_000000.tar
@@ -83,9 +80,9 @@ oc-mirror --from _<mirror-archive-file>_ _<target-registry>_
8380
--
8481
where:
8582

86-
`<mirror_archive_file>` :: Specifies the name of the file containing the resources that you want to mirror, for example,`mirror_seq1_0000.tar`.
83+
`<mirror_archive_file>` :: Enter the name of the file containing the resources that you want to mirror, for example,`mirror_seq1_0000.tar`.
8784

88-
`<target_registry>` :: Specifies the name of the target registry that you want to push the mirrored images to, for example, `docker://registry.localhost:5000`.
85+
`<target_registry>` :: Enter the name of the target registry that you want to push the mirrored images to, for example, `docker://registry.localhost:5000`.
8986
--
9087
+
9188
.Example output
@@ -121,9 +118,9 @@ oc apply -f _<workspace_directory>_/_<results_directory>_/ImageContentSourcePoli
121118
--
122119
where:
123120

124-
`<workspace-directory>` :: Specifies the name of your workspace directory, for example, `oc-mirror-workspace`.
121+
`<workspace-directory>` :: Enter the name of your workspace directory, for example, `oc-mirror-workspace`.
125122

126-
`<results-directory>` :: Specifies the name of your results directory, for example, `results-1738070846`.
123+
`<results-directory>` :: Enter the name of your results directory, for example, `results-1738070846`.
127124
--
128125
. 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:
129126
+
@@ -138,13 +135,13 @@ helm install _<rhdh_instance>_ _<workspace_directory>_/_<results_directory>_/cha
138135
--
139136
where:
140137

141-
`<rhdh_instance>` :: Specifies the name of your {product} instance, for example, `my-rhdh`.
138+
`<rhdh_instance>` :: Enter the name of your {product} instance, for example, `{my-product-namespace}`.
142139

143-
`<workspace_directory>` :: Specifies the name of your workspace directory, for example, `oc-mirror-workspace`.
140+
`<workspace_directory>` :: Enter the name of your workspace directory, for example, `oc-mirror-workspace`.
144141

145-
`<results_directory>` :: Specifies the name of your results directory, for example, `results-1738070846`.
142+
`<results_directory>` :: Enter the name of your results directory, for example, `results-1738070846`.
146143

147-
`<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`.
144+
`<archive_file>` :: Enter the name of the archive file containing the resources that you want to mirror, for example, `redhat-developer-hub-1.4.1.tgz`.
148145

149-
`<your_namespace>` :: Specifies the namespace that you want to deploy the Helm chart to, for example, `{my-product-namespace}`.
146+
`<your_namespace>` :: Enter the namespace that you want to deploy the Helm chart to, for example, `{my-product-namespace}`.
150147
--

modules/installation/proc-install-rhdh-helm-airgapped-partial.adoc

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ If your network has access to the `registry.redhat.io` registry and the `charts.
1111
* 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 {ocp-docs-link}/html-single/registry/index#securing-exposing-registry[Exposing the registry].
1212
* You are logged in to your target mirror registry and have permissions to push images to it. For more information, see {ocp-docs-link}/html-single/disconnected_environments/index#installation-adding-registry-pull-secret_about-installing-oc-mirror-v2[Configuring credentials that allow images to be mirrored].
1313
* You have installed the {openshift-cli} on your workstation.
14-
* {ocp-docs-link}/html-single/disconnected_environments/index#about-installing-oc-mirror-v2[You have installed the oc-mirror OpenShift CLI plugin].
14+
* Recommended on {ocp-short}: You have installed the {ocp-docs-link}/html-single/disconnected_environments/index#installation-oc-mirror-installing-plugin_about-installing-oc-mirror-v2[`oc-mirror`] tool, with a version corresponding to the version of your {ocp-short} cluster.
1515
* You have an account in https://developers.redhat.com/[{rhdeveloper-name}] portal.
1616
* Make sure that your system meets the minimum sizing requirements. See {about-book-link}#rhdh-sizing_about-rhdh[Sizing requirements for {product}].
1717

@@ -27,23 +27,20 @@ oc login -u <user> -p <password> https://api.<hostname>:6443
2727
. Create an `ImageSetConfiguration.yaml` file.
2828
. In your `ImageSetConfiguration.yaml` file, specify the resources that you want to mirror. For example:
2929
+
30-
[source,terminal,subs="+quotes"]
30+
[source,yaml,subs="+attributes,+quotes"]
3131
----
3232
apiVersion: mirror.openshift.io/v1alpha2
3333
kind: ImageSetConfiguration
3434
mirror:
3535
helm:
3636
repositories:
37-
- name: _<repository_name>_ (1)
38-
url: _<repository_url>_ (2)
37+
- name: openshift-charts
38+
url: https://charts.openshift.io
3939
charts:
40-
- name: _<chart_name>_ (3)
41-
version: "_<rhdh_version>_" (4)
40+
- name: redhat-developer-hub
41+
version: "{product-version}"
4242
----
43-
<1> The name of the repository containing the Helm chart that you want to mirror, for example, `openshift-charts`.
44-
<2> The URL for the repository containing the Helm chart that you want to mirror, for example, `https://charts.openshift.io`.
45-
<3> The name of the Helm chart containing the images that you want to mirror, for example, `redhat-developer-hub`.
46-
<4> The {product} version that you want to use, for example, `{product-version}`
43+
`version: "{product-version}"`:: Enter the {product} version to mirror.
4744

4845
. Mirror the resources specified in the image set configuration file directly to the target registry by running the `oc-mirror` command. For example:
4946
+

modules/installation/proc-install-rhdh-operator-airgapped-full.adoc

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,29 @@ If your network has access to the registry through a bastion host, you can use t
1515
* You have installed `umoci` CLI tool.
1616
* You have an active `oc registry`, `podman`, or `skopeo` session to the `registry.redhat.io` {company-name} Ecosystem Catalog. For more information, see link:link:https://access.redhat.com/articles/RegistryAuthentication[{company-name} Container Registry Authentication].
1717
* You have installed the `opm` CLI tool. For more information, see {ocp-docs-link}/html/cli_tools/opm-cli#olm-about-opm_cli-opm-install[Installing the opm CLI].
18+
* Recommended on {ocp-short}: You have installed the {ocp-docs-link}/html-single/disconnected_environments/index#installation-oc-mirror-installing-plugin_about-installing-oc-mirror-v2[`oc-mirror`] tool, with a version corresponding to the version of your {ocp-short} cluster.
1819
* Make sure that your system meets the minimum sizing requirements. See {about-book-link}#rhdh-sizing_about-rhdh[Sizing requirements for {product}].
1920
2021
.Procedure
2122
. Download the mirroring script to disk by running the following command:
2223
+
23-
[source,terminal,subs="attributes+"]
24+
[source,terminal,subs="+attributes,+quotes"]
2425
----
2526
curl -sSLO https://raw.githubusercontent.com/redhat-developer/rhdh-operator/refs/heads/release-{product-version}/.rhdh/scripts/prepare-restricted-environment.sh
2627
----
2728
+
2829
. Run the mirroring script by using the `bash` command with the appropriate set of options:
2930
+
30-
[source,terminal,subs="attributes+"]
31+
[source,terminal,subs="+attributes,+quotes"]
3132
----
3233
bash prepare-restricted-environment.sh
3334
--filter-versions "{product-version}"
34-
--to-dir _<my_pulled_image_location>_ <1>
35-
[--use-oc-mirror true] <2>
35+
--to-dir _<my_pulled_image_location>_
36+
[--use-oc-mirror true]
3637
----
37-
<1> 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`.
38-
<2> (Optional) Uses the `oc-mirror` {ocp-short} CLI plugin to mirror images.
38+
where:
39+
`--to-dir _<my_pulled_image_location>_`:: Enter the absolute path to a directory where you want to pull all of the necessary images, for example, `/home/user/rhdh-operator-mirror-dir`.
40+
`--use-oc-mirror true`:: (Recommended on {ocp-short}) Use the `oc-mirror` {ocp-short} CLI plugin to mirror images.
3941
+
4042
[NOTE]
4143
====
@@ -47,15 +49,16 @@ The script can take several minutes to complete as it copies multiple images to
4749
+
4850
[source,terminal,subs="+quotes,+attributes"]
4951
----
50-
bash _<my_pulled_image_location>_/install.sh <1>
51-
--from-dir _<my_pulled_image_location>_ <2>
52-
[--to-registry _<my.registry.example.com>_] <3>
53-
[--use-oc-mirror true] <4>
52+
bash _<my_pulled_image_location>_/install.sh
53+
--from-dir _<my_pulled_image_location>_
54+
[--to-registry _<my.registry.example.com>_]
55+
[--use-oc-mirror true]
5456
----
55-
<1> The downloaded image and the absolute path to the directory where it is stored on your system.
56-
<2> Specifies the directory where you want to pull all of the necessary images with the `--to-dir` option.
57-
<3> Specifies the URL for the target mirror registry where you want to mirror the images.
58-
<4> (Optional) Uses the `oc-mirror` {ocp-short} CLI plugin to mirror images.
57+
where:
58+
`_<my_pulled_image_location>_/install.sh`:: Enter the downloaded installation script and the absolute path to the directory where it is stored on your system.
59+
`--from-dir _<my_pulled_image_location>_`:: Enter the directory where you want to pull all of the necessary images.
60+
`--to-registry`:: (Optional) Enter the URL for the target mirror registry where you want to mirror the images.
61+
`--use-oc-mirror true`:: Recommended on {ocp-short}: Use the `oc-mirror` {ocp-short} CLI plugin to mirror images.
5962
+
6063
[IMPORTANT]
6164
====

0 commit comments

Comments
 (0)