Skip to content

Commit 030d1da

Browse files
authored
Merge pull request #84069 from skopacz1/OSDOCS-12410
OSDOCS#12410: first pass of oc-mirror v2 improvements
2 parents bc7d172 + c67395a commit 030d1da

16 files changed

+292
-156
lines changed

disconnected/mirroring/about-installing-oc-mirror-v2.adoc

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,33 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
You can run your cluster in a restricted network without direct internet connectivity if you install the cluster from a mirrored set of {product-title} container images in a private registry. This registry must be running whenever your cluster is running.
9+
You can run your cluster in a disconnected environment if you install the cluster from a mirrored set of {product-title} container images in a private registry. This registry must be running whenever your cluster is running.
1010

11-
Just as you can use the `oc-mirror` OpenShift CLI (`oc`) plugin, you can also use oc-mirror plugin v2 to mirror images to a mirror registry in your fully or partially disconnected environments. To download the required images from the official Red Hat registries, you must run oc-mirror plugin v2 from a system with internet connectivity.
11+
Just as you can use the `oc-mirror` OpenShift CLI (`oc`) plugin, you can also use oc-mirror plugin v2 to mirror images to a mirror registry in your fully or partially disconnected environments. To download the required images from the official Red{nbsp}Hat registries, you must run oc-mirror plugin v2 from a system with internet connectivity.
1212

1313
:FeatureName: oc-mirror plugin v2
1414
include::snippets/technology-preview.adoc[]
1515

16+
// About oc-mirror plugin v2
17+
include::modules/oc-mirror-v2-about.adoc[leveloffset=+1]
18+
19+
// oc-mirror compatibility and support
20+
include::modules/oc-mirror-v2-support.adoc[leveloffset=+2]
21+
1622
[id="prerequisites_oc-mirror-v2_{context}"]
1723
== Prerequisites
1824

1925
* You must have a container image registry that supports link:https://docs.docker.com/registry/spec/manifest-v2-2[Docker V2-2] in the location that hosts the {product-title} cluster, such as {quay}.
2026
+
2127
[NOTE]
2228
====
23-
If you use {quay}, use version 3.6 or later with the oc-mirror plugin. See the documentation on link:https://access.redhat.com/documentation/en-us/red_hat_quay/3/html/deploying_the_red_hat_quay_operator_on_openshift_container_platform/index[Deploying the Red Hat Quay Operator on OpenShift Container Platform (Red Hat Quay documentation)]. If you need additional assistance selecting and installing a registry, contact your sales representative or Red Hat Support.
24-
====
29+
* If you use {quay}, use version 3.6 or later with the oc-mirror plugin. See link:https://access.redhat.com/documentation/en-us/red_hat_quay/3/html/deploying_the_red_hat_quay_operator_on_openshift_container_platform/index[Deploying the Red{nbsp}Hat Quay Operator on {product-title} (Red{nbsp}Hat Quay documentation)]. If you need additional assistance selecting and installing a registry, contact your sales representative or Red{nbsp}Hat Support.
2530
26-
[Optional]
27-
* If you do not have an existing solution for a container image registry, {product-title} subscribers receive a mirror registry for Red Hat OpenShift. This mirror registry is included with your subscription and serves as a small-scale container registry. You can use this registry to mirror the necessary container images of {product-title} for disconnected installations.
31+
* If you do not have an existing solution for a container image registry, {product-title} subscribers receive a mirror registry for Red{nbsp}Hat OpenShift. This mirror registry is included with your subscription and serves as a small-scale container registry. You can use this registry to mirror the necessary container images of {product-title} for disconnected installations.
32+
====
2833

2934
* Every machine in the provisioned clusters must have access to the mirror registry. If the registry is unreachable, tasks like installation, updating, or routine operations such as workload relocation, might fail. Mirror registries must be operated in a highly available manner, ensuring their availability aligns with the production availability of your {product-title} clusters.
3035

31-
.High level workflow
32-
33-
The following steps outline the high-level workflow on how to mirror images to a mirror registry by using the oc-mirror plugin v2:
34-
35-
. Create an image set configuration file.
36-
37-
. Mirror the image set to the target mirror registry by using one of the following workflows:
38-
39-
* Mirror an image set directly to the target mirror registry (mirror to mirror).
40-
41-
** 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).
42-
43-
. Configure your cluster to use the resources generated by the oc-mirror plugin v2.
44-
45-
. Repeat these steps to update your target mirror registry as necessary.
46-
47-
48-
// About oc-mirror plugin v2
49-
include::modules/oc-mirror-v2-about.adoc[leveloffset=+1]
50-
51-
// oc-mirror compatibility and support
52-
include::modules/oc-mirror-v2-support.adoc[leveloffset=+2]
53-
5436
//Preparing your mirror hosts
5537
include::modules/oc-mirror-preparing-mirror-hosts.adoc[leveloffset=+1]
5638

@@ -65,28 +47,37 @@ include::modules/installation-adding-registry-pull-secret.adoc[leveloffset=+2]
6547

6648
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.
6749

68-
//Building the image set configuration
50+
//Creating the image set configuration
6951
include::modules/oc-mirror-building-image-set-config-v2.adoc[leveloffset=+2]
7052

71-
//oc-mirror-workflows: mirroring in partially disconnected environment
53+
[role="_additional-resources"]
54+
.Additional resources
55+
56+
* xref:../../updating/understanding_updates/intro-to-updates.adoc#update-service-about_understanding-openshift-updates[About the OpenShift Update Service]
57+
58+
//Mirroring an image set in a partially disconnected environment
7259
include::modules/oc-mirror-workflows-partially-disconnected-v2.adoc[leveloffset=+2]
7360

7461
//Mirroring an image set in a fully disconnected environment:
7562
include::modules/oc-mirror-workflows-fully-disconnected-v2.adoc[leveloffset=+2]
7663
include::modules/oc-mirror-mirror-to-disk-v2.adoc[leveloffset=+2]
7764
include::modules/oc-mirror-disk-to-mirror-v2.adoc[leveloffset=+2]
7865

79-
[id="additional-resources_{context}"]
80-
== Additional resources
81-
82-
* xref:../../disconnected/updating/disconnected-update-osus.adoc#updating-disconnected-cluster-osus[Updating a cluster in a disconnected environment using the OpenShift Update Service]
83-
8466
// About custom resources generated by v2
8567
include::modules/oc-mirror-IDMS-ITMS-about.adoc[leveloffset=+1]
8668

69+
[role="_additional-resources"]
70+
.Additional resources
71+
72+
* xref:../../rest_api/config_apis/imagedigestmirrorset-config-openshift-io-v1.adoc#imagedigestmirrorset-config-openshift-io-v1[ImageDigestMirrorSet]
73+
74+
* xref:../../rest_api/config_apis/imagetagmirrorset-config-openshift-io-v1.adoc#imagetagmirrorset-config-openshift-io-v1[ImageTagMirrorSet]
75+
8776
// Configuring your cluster to use the resources generated by oc-mirror
8877
include::modules/oc-mirror-updating-cluster-manifests-v2.adoc[leveloffset=+2]
8978

79+
Once your cluster is configured to use the resources generated by oc-mirror plugin v2, see xref:../../disconnected/mirroring/about-installing-oc-mirror-v2.adoc#next-steps_about-installing-oc-mirror-v2[Next Steps] for information about tasks that you can perform using your mirrored images.
80+
9081
//Delete Feature
9182
// workflows of delete feature
9283
include::modules/oc-mirror-workflows-delete-v2.adoc[leveloffset=+1]
@@ -109,6 +100,10 @@ include::modules//oc-mirror-enclave-support-about.adoc[leveloffset=+1]
109100
// How to mirror to an Enclave
110101
include::modules/oc-mirror-enclave-support.adoc[leveloffset=+2]
111102

103+
[role="_additional-resources"]
104+
.Additional resources
105+
* xref:../../disconnected/updating/disconnected-update-osus.adoc#updating-disconnected-cluster-osus[Updating a cluster in a disconnected environment using the OpenShift Update Service]
106+
112107
//operator catalog filtering
113108
include::modules/oc-mirror-operator-catalog-filtering.adoc[leveloffset=+1]
114109

@@ -118,3 +113,14 @@ include::modules/oc-mirror-imageset-config-parameters-v2.adoc[leveloffset=+1]
118113
// Command reference for oc-mirror v2
119114
include::modules/oc-mirror-command-reference-v2.adoc[leveloffset=+1]
120115
* xref:../../disconnected/mirroring/about-installing-oc-mirror-v2.adoc#oc-mirror-updating-cluster-manifests-v2_about-installing-oc-mirror-v2[Configuring your cluster to use the resources generated by oc-mirror]
116+
117+
[id="next-steps_{context}"]
118+
== Next steps
119+
120+
After you mirror images to your disconnected environment using oc-mirror plugin v2, you can perform any of the following actions:
121+
122+
* xref:../../disconnected/installing.adoc#installing-disconnected-environments[Installing a cluster in a disconnected environment]
123+
* xref:../../disconnected/using-olm.adoc#olm-restricted-networks[Using Operator Lifecycle Manager in disconnected environments]
124+
* xref:../../disconnected/updating/disconnected-update-osus.adoc#updating-disconnected-cluster-osus[Updating a cluster in a disconnected environment using the OpenShift Update Service]
125+
126+
// Intentionally linking to the OSUS update procedure since we probably want to steer users to do that workflow as much as possible. But I can change to the index of the update section if I shouldn't be as prescriptive.

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

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ endif::[]
2222

2323
ifeval::["{context}" == "about-installing-oc-mirror-v2"]
2424
:oc-mirror-v2:
25+
:restricted:
2526
endif::[]
2627

2728
:_mod-docs-content-type: PROCEDURE
2829
[id="installation-adding-registry-pull-secret_{context}"]
2930
= Configuring credentials that allow images to be mirrored
3031

31-
Create a container image registry credentials file that enables you to mirror images from Red Hat to your mirror.
32+
Create a container image registry credentials file that enables you to mirror images from Red{nbsp}Hat to your mirror.
3233

3334
ifdef::restricted[]
3435
[WARNING]
@@ -37,13 +38,7 @@ Do not use this image registry credentials file as the pull secret when you inst
3738
====
3839
endif::restricted[]
3940

40-
ifdef::restricted[]
41-
[WARNING]
42-
====
43-
This process requires that you have write access to a container image registry on the mirror registry and adds the credentials to a registry pull secret.
44-
====
45-
46-
endif::restricted[]
41+
// removed this warning since the first part is more of a prereq, and the second part seems to just describe what will happen later in the procedure. Can revert/modify as needed.
4742

4843
.Prerequisites
4944
ifndef::openshift-rosa,openshift-dedicated[]
@@ -55,6 +50,7 @@ endif::openshift-rosa,openshift-dedicated[]
5550
ifdef::restricted[]
5651
* You identified an image repository location on your mirror registry to mirror images into.
5752
* You provisioned a mirror registry account that allows images to be uploaded to that image repository.
53+
* You have write access to the mirror registry.
5854
endif::restricted[]
5955

6056
.Procedure
@@ -64,16 +60,15 @@ Complete the following steps on the installation host:
6460
ifndef::openshift-origin[]
6561
. Download your `registry.redhat.io` {cluster-manager-url-pull}.
6662

67-
. Make a copy of your pull secret in JSON format:
63+
. Make a copy of your pull secret in JSON format by running the following command:
6864
+
6965
[source,terminal]
7066
----
7167
$ cat ./pull-secret | jq . > <path>/<pull_secret_file_in_json> <1>
7268
----
7369
<1> Specify the path to the folder to store the pull secret in and a name for the JSON file that you create.
7470
+
75-
The contents of the file resemble the following example:
76-
+
71+
.Example pull secret
7772
[source,json]
7873
----
7974
{
@@ -116,7 +111,7 @@ $ cp <path>/<pull_secret_file_in_json> <directory_name>/<auth_file>
116111
----
117112
+
118113
Where `<directory_name>` is either `~/.docker` or `$XDG_RUNTIME_DIR/containers`, and `<auth_file>` is either `config.json` or `auth.json`.
119-
endif::[]
114+
endif::oc-mirror[]
120115
// 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)
121116
ifdef::update-oc-mirror[]
122117
. Optional: If using the oc-mirror plugin, save the file as either `~/.docker/config.json` or `$XDG_RUNTIME_DIR/containers/auth.json`:
@@ -136,59 +131,74 @@ $ cp <path>/<pull_secret_file_in_json> <directory_name>/<auth_file>
136131
----
137132
+
138133
Where `<directory_name>` is either `~/.docker` or `$XDG_RUNTIME_DIR/containers`, and `<auth_file>` is either `config.json` or `auth.json`.
139-
endif::[]
134+
endif::update-oc-mirror[]
140135
// Additional step for allowing this procedure for oc-mirror-v2
136+
// Should this step below also have the "if you don't have this directory, create it using this command" substeps?
141137
ifdef::oc-mirror-v2[]
142-
. Save the file as `$XDG_RUNTIME_DIR/containers/auth.json`.
143-
endif::[]
144-
endif::[]
145-
146-
. Generate the base64-encoded user name and password or token for your mirror registry:
138+
. If the `$XDG_RUNTIME_DIR/containers` directory does not exist, create one by entering the following command:
139+
+
140+
[source,terminal]
141+
----
142+
$ mkdir -p $XDG_RUNTIME_DIR/containers
143+
----
144+
145+
. Save the pull secret file as `$XDG_RUNTIME_DIR/containers/auth.json`.
146+
endif::oc-mirror-v2[]
147+
endif::openshift-origin[]
148+
149+
. Generate the base64-encoded user name and password or token for your mirror registry by running the following command:
147150
+
148151
[source,terminal]
149152
----
150153
$ echo -n '<user_name>:<password>' | base64 -w0 <1>
151-
BGVtbYk3ZHAtqXs=
152154
----
153155
<1> For `<user_name>` and `<password>`, specify the user name and password that you configured for your registry.
156+
+
157+
.Example output
158+
[source,terminal]
159+
----
160+
BGVtbYk3ZHAtqXs=
161+
----
154162

155-
ifndef::openshift-origin[]
156-
. Edit the JSON
157-
endif::[]
158163
ifdef::openshift-origin[]
159-
. Create a `.json`
160-
endif::[]
161-
file and add a section that describes your registry to it:
164+
. Create a `.json` file and add a section that describes your registry to it:
162165
+
163166
[source,json]
164167
----
165-
ifndef::openshift-origin[]
168+
{
166169
"auths": {
167170
"<mirror_registry>": { <1>
168171
"auth": "<credentials>", <2>
169172
"email": "you@example.com"
170173
}
171-
},
172-
endif::[]
173-
ifdef::openshift-origin[]
174-
{
174+
}
175+
}
176+
----
177+
<1> Specify the registry domain name, and optionally the port, that your mirror registry uses to serve content. For example,
178+
`registry.example.com` or `registry.example.com:8443`
179+
<2> Specify the base64-encoded user name and password for
180+
the mirror registry.
181+
182+
endif::openshift-origin[]
183+
184+
ifndef::openshift-origin[]
185+
. Edit the JSON file and add a section that describes your registry to it:
186+
+
187+
[source,json]
188+
----
175189
"auths": {
176190
"<mirror_registry>": { <1>
177191
"auth": "<credentials>", <2>
178192
"email": "you@example.com"
179193
}
180-
}
181-
}
182-
endif::[]
194+
},
183195
----
184196
<1> Specify the registry domain name, and optionally the port, that your mirror registry uses to serve content. For example,
185197
`registry.example.com` or `registry.example.com:8443`
186198
<2> Specify the base64-encoded user name and password for
187199
the mirror registry.
188200
+
189-
ifndef::openshift-origin[]
190-
The file resembles the following example:
191-
+
201+
.Example modified pull secret
192202
[source,json]
193203
----
194204
{
@@ -216,7 +226,7 @@ The file resembles the following example:
216226
}
217227
}
218228
----
219-
endif::[]
229+
endif::openshift-origin[]
220230
221231
////
222232
This is not currently working as intended.
@@ -246,5 +256,6 @@ endif::[]
246256
247257
ifeval::["{context}" == "about-installing-oc-mirror-v2"]
248258
:!oc-mirror-v2:
259+
:!restricted:
249260
endif::[]
250261

modules/oc-mirror-IDMS-ITMS-about.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
[id="oc-mirror-custom-resources-v2_{context}"]
77
= About custom resources generated by v2
88

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.
9+
// Should sentence below say "to which a digest or tag refers"?
1010

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.
11+
With oc-mirror plugin v2, `ImageDigestMirrorSet` (IDMS) resources are generated by default if at least one image of the image set is mirrored by digest.
12+
`ImageTagMirrorSet` (ITMS) resources are generated if at least one image from the image set is mirrored by tag.
1213

1314
Operator Lifecycle Manager (OLM) uses the `CatalogSource` resource to retrieve information about the available Operators in the mirror registry.
1415

15-
The OSUS service uses the `UpdateService` resource to provide Cincinnati graph to the disconnected environment.
16+
The OpenShift Update Service uses the `UpdateService` resource to provide update graph data to the disconnected environment.

0 commit comments

Comments
 (0)