Skip to content

Commit 0ddf6ee

Browse files
authored
Merge pull request #77247 from subhtk/ocm-v2-part2
OSDOCS 8197: Updated oc-mirror v2 section for partially and fully disconnected environment updates
2 parents 04ee179 + 5283f08 commit 0ddf6ee

14 files changed

+309
-21
lines changed

installing/disconnected_install/about-installing-oc-mirror-v2.adoc

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[id="about-installing-oc-mirror-v2"]
33
= Mirroring images for a disconnected installation by using the oc-mirror plugin v2
44
include::_attributes/common-attributes.adoc[]
5-
:context: installing-mirroring-disconnected
5+
:context: about-installing-oc-mirror-v2
66

77
toc::[]
88

@@ -36,7 +36,7 @@ The following steps outline the high-level workflow on how to mirror images to a
3636

3737
. Mirror the image set to the target mirror registry by using one of the following workflows:
3838

39-
** Mirror an image set directly to the target mirror registry (Mirror-to-Mirror).
39+
* Mirror an image set directly to the target mirror registry (mirror to mirror).
4040

4141
** Mirror an image set to disk (Mirror-to-Disk), transfer the `tar` file to the target environment, then mirror the image set to the target mirror registry (Disk-to-Mirror).
4242

@@ -51,6 +51,42 @@ include::modules/oc-mirror-v2-about.adoc[leveloffset=+1]
5151
// oc-mirror compatibility and support
5252
include::modules/oc-mirror-v2-support.adoc[leveloffset=+2]
5353

54+
//Preparing your mirror hosts
55+
include::modules/oc-mirror-preparing-mirror-hosts.adoc[leveloffset=+1]
56+
57+
//Installing oc-mirror plugin v2
58+
include::modules/oc-mirror-installing-plugin.adoc[leveloffset=+2]
59+
60+
//Configuring credentials that enable image mirroring
61+
include::modules/installation-adding-registry-pull-secret.adoc[leveloffset=+2]
62+
63+
[id="using-oc-mirror_{context}"]
64+
== Mirroring an image set to a mirror registry
65+
66+
Mirroring an image set to a mirror registry ensures that the required images are available in a secure and controlled environment, facilitating smoother deployments, updates, and maintenance tasks.
67+
68+
//Building the image set configuration
69+
include::modules/oc-mirror-building-image-set-config-v2.adoc[leveloffset=+2]
70+
71+
//oc-mirror-workflows: mirroring in partially disconnected environment
72+
include::modules/oc-mirror-workflows-partially-disconnected-v2.adoc[leveloffset=+2]
73+
74+
//Mirroring an image set in a fully disconnected environment:
75+
include::modules/oc-mirror-workflows-fully-disconnected-v2.adoc[leveloffset=+2]
76+
include::modules/oc-mirror-mirror-to-disk-v2.adoc[leveloffset=+2]
77+
include::modules/oc-mirror-disk-to-mirror-v2.adoc[leveloffset=+2]
78+
79+
[id="additional-resources"]
80+
== Additional resources
81+
82+
* xref:../../updating/updating_a_cluster/updating_disconnected_cluster/disconnected-update-osus.html[Updating a cluster in a disconnected environment using the OpenShift Update Service].
83+
84+
// About custom resources generated by v2
85+
include::modules/oc-mirror-IDMS-ITMS-about.adoc[leveloffset=+1]
86+
87+
// Configuring your cluster to use the resources generated by oc-mirror
88+
include::modules/oc-mirror-updating-cluster-manifests-v2.adoc[leveloffset=+2]
89+
5490
//Delete Feature
5591
// workflows of delete feature
5692
include::modules/oc-mirror-workflows-delete-v2.adoc[leveloffset=+1]
@@ -70,16 +106,12 @@ include::modules//oc-mirror-enclave-support-about.adoc[leveloffset=+1]
70106
// How to mirror to an Enclave
71107
include::modules/oc-mirror-enclave-support.adoc[leveloffset=+2]
72108

73-
[id="additional-resources"]
74-
== Additional resources
75-
76-
* xref:../../updating/updating_a_cluster/updating_disconnected_cluster/disconnected-update-osus.html[Updating a cluster in a disconnected environment using the OpenShift Update Service].
77-
78109
//operator catalog filtering
79110
include::modules/oc-mirror-operator-catalog-filtering.adoc[leveloffset=+1]
80111

81112
//Image set configuration parameters
82113
include::modules/oc-mirror-imageset-config-parameters-v2.adoc[leveloffset=+1]
83114

84115
// Command reference for oc-mirror v2
85-
include::modules/oc-mirror-command-reference-v2.adoc[leveloffset=+1]
116+
include::modules/oc-mirror-command-reference-v2.adoc[leveloffset=+1]
117+
* xref:../../installing/disconnected_install/about-installing-oc-mirror-v2.adoc#oc-mirror-updating-cluster-manifests-v2_installing-mirroring-disconnected[Configuring your cluster to use the resources generated by oc-mirror]

modules/installation-adding-registry-pull-secret.adoc

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ ifeval::["{context}" == "installing-mirroring-disconnected"]
2020
:oc-mirror:
2121
endif::[]
2222

23+
ifeval::["{context}" == "about-installing-oc-mirror-v2"]
24+
:oc-mirror-v2:
25+
endif::[]
26+
2327
:_mod-docs-content-type: PROCEDURE
2428
[id="installation-adding-registry-pull-secret_{context}"]
2529
= Configuring credentials that allow images to be mirrored
2630

27-
Create a container image registry credentials file that allows mirroring
28-
images from Red Hat to your mirror.
31+
Create a container image registry credentials file that enables you to mirror images from Red Hat to your mirror.
2932

3033
ifdef::restricted[]
3134
[WARNING]
@@ -98,6 +101,10 @@ The contents of the file resemble the following example:
98101
ifdef::oc-mirror[]
99102
. Save the file either as `~/.docker/config.json` or `$XDG_RUNTIME_DIR/containers/auth.json`.
100103
endif::[]
104+
105+
ifdef::oc-mirror-v2[]
106+
. Save the file as `$XDG_RUNTIME_DIR/containers/auth.json`.
107+
endif::[]
101108
// Similar to the additional step above, except it is framed as optional because it is included in a disconnected update page (where users may or may not use oc-mirror for their process)
102109
ifdef::update-oc-mirror[]
103110
. Optional: If using the oc-mirror plugin, save the file either as `~/.docker/config.json` or `$XDG_RUNTIME_DIR/containers/auth.json`.
@@ -142,10 +149,9 @@ ifdef::openshift-origin[]
142149
}
143150
endif::[]
144151
----
145-
<1> For `<mirror_registry>`, specify the registry domain name, and optionally the
146-
port, that your mirror registry uses to serve content. For example,
152+
<1> Specify the registry domain name, and optionally the port, that your mirror registry uses to serve content. For example,
147153
`registry.example.com` or `registry.example.com:8443`
148-
<2> For `<credentials>`, specify the base64-encoded user name and password for
154+
<2> Specify the base64-encoded user name and password for
149155
the mirror registry.
150156
+
151157
ifndef::openshift-origin[]
@@ -205,3 +211,8 @@ ifeval::["{context}" == "installing-mirroring-disconnected"]
205211
:!restricted:
206212
:!oc-mirror:
207213
endif::[]
214+
215+
ifeval::["{context}" == "about-installing-oc-mirror-v2"]
216+
:!oc-mirror-v2:
217+
endif::[]
218+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * installing/disconnected_install/installing-mirroring-disconnected-v2.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="oc-mirror-custom-resources-v2_{context}"]
7+
= About custom resources generated by v2
8+
9+
With oc-mirror plugin v2, `ImageDigestMirrorSet` (IDMS) and `ImageTagMirrorSet` (ITMS) are generated by default if at least one image is found to which a tag refers. These sets contain mirrors for images referenced by digest or tag in releases, Operator catalogs and additional images.
10+
11+
The `ImageDigestMirrorSet` (IDMS) links the mirror registry to the source registry and forwards image pull requests using digest specifications. The `ImagetagMirrorSet` (ITMS) resource, however, redirects image pull requests by using image tags.
12+
13+
Operator Lifecycle Manager (OLM) uses the `CatalogSource` resource to retrieve information about the available Operators in the mirror registry.
14+
15+
The OSUS service uses the `UpdateService` resource to provide Cincinnati graph to the disconnected environment.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * installing/disconnected_install/installing-mirroring-disconnected-v2.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="oc-mirror-building-image-set-config-v2_{context}"]
7+
= Building the image set configuration
8+
9+
The oc-mirror plugin v2 uses the image set configuration as the input file to determine the required images for mirroring.
10+
11+
.Example for the `ImageSetConfiguration` input file
12+
[source,yaml]
13+
----
14+
kind: ImageSetConfiguration
15+
apiVersion: mirror.openshift.io/v2alpha1
16+
mirror:
17+
platform:
18+
channels:
19+
- name: stable-4.13
20+
minVersion: 4.13.10
21+
maxVersion: 4.13.10
22+
graph: true
23+
operators:
24+
- catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
25+
packages:
26+
- name: aws-load-balancer-operator
27+
- name: 3scale-operator
28+
- name: node-observability-operator
29+
additionalImages:
30+
- name: registry.redhat.io/ubi8/ubi:latest
31+
- name: registry.redhat.io/ubi9/ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0
32+
----

modules/oc-mirror-creating-image-set-config.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ Do not delete or modify the metadata that is generated by the oc-mirror plugin.
1818

1919
.Prerequisites
2020

21-
* You have created a container image registry credentials file. For instructions, see _Configuring credentials that allow images to be mirrored_.
21+
* You have created a container image registry credentials file. For instructions, see "Configuring credentials that allow images to be mirrored".
2222
2323
.Procedure
2424

2525
. Use the `oc mirror init` command to create a template for the image set configuration and save it to a file called `imageset-config.yaml`:
2626
+
2727
[source,terminal]
2828
----
29-
$ oc mirror init --registry example.com/mirror/oc-mirror-metadata > imageset-config.yaml <1>
29+
$ oc mirror init <--registry <storage_backend> > imageset-config.yaml <1>
3030
----
31-
<1> Replace `example.com/mirror/oc-mirror-metadata` with the location of your registry for the storage backend.
31+
<1> Specifies the location of your storage backend, such as `example.com/mirror/oc-mirror-metadata`.
3232

3333
. Edit the file and adjust the settings as necessary:
3434
+
@@ -72,7 +72,7 @@ mirror:
7272
The `graph: true` field also mirrors the `ubi-micro` image along with other mirrored images.
7373
====
7474
+
75-
See _Image set configuration parameters_ for the full list of parameters and _Image set configuration examples_ for various mirroring use cases.
75+
See "Image set configuration parameters" for the full list of parameters and "Image set configuration examples" for various mirroring use cases.
7676

7777
. Save the updated file.
7878
+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * installing/disconnected_install/installing-mirroring-disconnected-v2.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="disk-mirror-v2_{context}"]
7+
== Mirroring from disk to mirror
8+
9+
You can use the `oc-mirror` plugin v2 to mirror image sets from a disk to a target mirror registry.
10+
11+
The `oc-mirror` plugin v2 retrieves container images from a local disk and transfers them to the specified mirror registry.
12+
13+
.Procedure
14+
15+
* Process the image set file on the disk and mirror the contents to a target mirror registry by running the following command:
16+
+
17+
[source,terminal]
18+
----
19+
$ oc mirror -c isc.yaml --from file://<file_path> docker://<mirror_registry_url> --v2 <1>
20+
----
21+
<1> Specify the URL or address of the mirror registry where the images are stored and from which they need to be deleted.
22+
23+
.Verification
24+
25+
. Navigate to the `cluster-resources` directory within the `working-dir` directory that was generated in the `<file_path>` directory.
26+
. Verify that the YAML files are present for the `ImageDigestMirrorSet`, `ImageTagMirrorSet` and `CatalogSource` resources.
27+
28+
.Next steps
29+
30+
* Configure your cluster to use the resources generated by oc-mirror plugin v2.

modules/oc-mirror-dry-run-v2.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[id="oc-mirror-dry-run-v2_{context}"]
88
= Performing dry run for oc-mirror plugin v2
99

10-
To perform a dry run and verify your image set configuration without mirroring any images, follow the procedure.
10+
Verify your image set configuration by performing a dry run without mirroring any images. This ensures your setup is correct and prevents unintended changes.
1111

1212
.Procedure
1313

modules/oc-mirror-installing-plugin.adoc

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,21 @@
33
// * installing/disconnected_install/installing-mirroring-disconnected.adoc
44
// * updating/updating_a_cluster/updating_disconnected_cluster/mirroring-image-repository.adoc
55

6+
ifeval::["{context}" == "installing-mirroring-disconnected"]
7+
:oc-mirror:
8+
endif::[]
9+
10+
ifeval::["{context}" == "about-installing-oc-mirror-v2"]
11+
:oc-mirror-v2:
12+
:restricted:
13+
endif::[]
14+
615
:_mod-docs-content-type: PROCEDURE
716
[id="installation-oc-mirror-installing-plugin_{context}"]
817
= Installing the oc-mirror OpenShift CLI plugin
918

19+
Install the oc-mirror OpenShift CLI plugin to manage image sets in disconnected environments.
20+
1021
.Prerequisites
1122

1223
* You have installed the OpenShift CLI (`oc`). If you are mirroring image sets in a fully disconnected environment, ensure the following:
@@ -56,9 +67,28 @@ $ sudo mv oc-mirror /usr/local/bin/.
5667

5768
.Verification
5869

59-
* Run `oc mirror help` to verify that the plugin was successfully installed:
70+
ifdef::oc-mirror[]
71+
* Verify that the plugin for oc-mirror v1 is successfully installed by running the following command:
6072
+
6173
[source,terminal]
6274
----
6375
$ oc mirror help
6476
----
77+
endif::[]
78+
79+
ifdef::oc-mirror-v2[]
80+
* Verify that the plugin for oc-mirror v2 is successfully installed by running the following command:
81+
+
82+
[source,terminal]
83+
----
84+
$ oc mirror --v2 --help
85+
----
86+
endif::[]
87+
88+
ifeval::["{context}" == "about-installing-oc-mirror-v2"]
89+
:!oc-mirror-v2:
90+
endif::[]
91+
92+
ifeval::["{context}" == "installing-mirroring-disconnected"]
93+
:!oc-mirror:
94+
endif::[]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * installing/disconnected_install/installing-mirroring-disconnected-v2.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="mirror-to-disk-v2_{context}"]
7+
== Mirroring from mirror to disk
8+
9+
You can use the oc-mirror plugin v2 to generate an image set and save the content to disk. You can then transfer the generated image set can to the disconnected environment and mirrored to the target registry.
10+
11+
oc-mirror plugin v2 retrieves the container images from the source specified in the image set configuration and packs them into a tar archive in a local directory.
12+
13+
.Procedure
14+
15+
* Mirror the images from the specified image set configuration to the disk by running the following command:
16+
+
17+
[source,terminal]
18+
----
19+
$ oc mirror -c isc.yaml file://<file_path> --v2 <1>
20+
----
21+
<1> Add the required file path.
22+
23+
.Verification
24+
25+
. Navigate to the `<file_path>` directory that was generated.
26+
. Verify that the archive files have been generated.
27+
28+
.Next steps
29+
30+
* Configure your cluster to use the resources generated by oc-mirror plugin v2.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * installing/disconnected_install/installing-mirroring-disconnected-v2.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="oc-mirror-preparing-mirror-hosts_{context}"]
7+
= Preparing your mirror hosts
8+
9+
To use the oc-mirror plugin v2 for image mirroring, you need to install the plugin and create a file with credentials for container images, enabling you to mirror from Red Hat to your mirror.

0 commit comments

Comments
 (0)