Skip to content

Commit ac22ba6

Browse files
committed
OSDOCS-3567: Updating docs for oc-mirror GA
1 parent 6416a61 commit ac22ba6

12 files changed

+480
-128
lines changed

installing/disconnected_install/installing-mirroring-disconnected.adoc

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,16 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
////
10-
General to do list:
11-
* Confirm that no new content was added since I did the reorg of the disconnected install assemblies (up to date as of 2/13)
12-
* Add info about mirroring to a namespace
13-
* Test and get some actual example output
14-
* Use cases for changing image set config between runs
15-
////
9+
Running your cluster in a restricted network without direct internet connectivity is possible by installing the cluster from a mirrored set of {product-title} container images in a private registry. This registry must be running at all times as long as the cluster is running. See the xref:../../installing/disconnected_install/installing-mirroring-disconnected.adoc#prerequisites_installing-mirroring-disconnected[Prerequisites] section for more information.
1610

17-
You can ensure your clusters only use container images that satisfy your organizational controls on external content. Before you install a cluster on infrastructure that you provision in a restricted network, you must mirror the required container images into that environment. To mirror container images, you must have a registry for mirroring.
18-
19-
You can use the oc-mirror OpenShift CLI (`oc`) plug-in to mirror images to a mirror registry in your fully or partially disconnected environments.
20-
21-
:FeatureName: Mirroring images for disconnected environments using the oc-mirror plug-in
22-
include::snippets/technology-preview.adoc[leveloffset=+1]
11+
You can use the oc-mirror OpenShift CLI (`oc`) plug-in to mirror images to a mirror registry in your fully or partially disconnected environments. You must run oc-mirror from a system with internet connectivity in order to download the required images from the official Red Hat registries.
2312

2413
The following steps outline the high-level workflow on how to use the oc-mirror plug-in to mirror images to a mirror registry:
2514

2615
. Create an image set configuration file.
27-
. Mirror the image set to the mirror registry.
16+
. Mirror the image set to the mirror registry by using one of the following methods:
17+
** Mirror an image set directly to the mirror registry.
18+
** Mirror an image set to disk, transfer the image set to the target environment, then upload the image set to the target mirror registry.
2819
. Install the `ImageContentSourcePolicy` and `CatalogSource` resources that were generated by oc-mirror into the cluster.
2920
. Repeat these steps to update your mirror registry as necessary.
3021

@@ -76,6 +67,7 @@ include::modules/oc-mirror-creating-image-set-config.adoc[leveloffset=+1]
7667

7768
* xref:../../installing/disconnected_install/installing-mirroring-disconnected.adoc#oc-mirror-imageset-config-params_installing-mirroring-disconnected[Image set configuration parameters]
7869
* xref:../../installing/disconnected_install/installing-mirroring-disconnected.adoc#oc-mirror-image-set-examples_installing-mirroring-disconnected[Image set configuration examples]
70+
* xref:../../updating/updating-restricted-network-cluster.adoc#update-service-overview_updating-restricted-network-cluster[About the OpenShift Update Service]
7971

8072
[id="mirroring-image-set"]
8173
== Mirroring an image set to a mirror registry
@@ -109,20 +101,35 @@ include::modules/oc-mirror-updating-cluster-manifests.adoc[leveloffset=+1]
109101
// TODO: Consider whether we want any sort of reference module on how to use `oc mirror` (the 3 ways etc)
110102
// Maybe consider adding the blurb just to the beginning of the procedure modules (the combo of params?)
111103

112-
// Updating your mirror registry with differential updates
113-
include::modules/oc-mirror-differential-updates.adoc[leveloffset=+1]
104+
[id="updating-mirror-registry-content"]
105+
== Keeping your mirror registry content updated
106+
107+
After your target mirror registry is populated with the initial image set, be sure to update it regularly so that it has the latest content. You can optionally set up a cron job, if possible, so that the mirror registry is updated on a regular basis.
108+
109+
Ensure that you update your image set configuration to add or remove {product-title} and Operator releases as necessary. Any images that are removed are pruned from the mirror registry.
110+
111+
// About updating your mirror registry content
112+
include::modules/oc-mirror-updating-registry-about.adoc[leveloffset=+2]
113+
114+
// Updating your mirror registry content
115+
include::modules/oc-mirror-differential-updates.adoc[leveloffset=+2]
114116

115117
[role="_additional-resources"]
116118
.Additional resources
117119

120+
* xref:../../installing/disconnected_install/installing-mirroring-disconnected.adoc#oc-mirror-image-set-examples_installing-mirroring-disconnected[Image set configuration examples]
118121
* xref:../../installing/disconnected_install/installing-mirroring-disconnected.adoc#mirroring-image-set-partial[Mirroring an image set in a partially disconnected environment]
119122
* xref:../../installing/disconnected_install/installing-mirroring-disconnected.adoc#mirroring-image-set-full[Mirroring an image set in a fully disconnected environment]
120123
* xref:../../installing/disconnected_install/installing-mirroring-disconnected.adoc#oc-mirror-updating-cluster-manifests_installing-mirroring-disconnected[Installing the ImageContentSourcePolicy and CatalogSource resources into the cluster]
121124

125+
// Performing a dry run
126+
include::modules/oc-mirror-dry-run.adoc[leveloffset=+1]
127+
122128
// Image set configuration parameters
123129
include::modules/oc-mirror-imageset-config-params.adoc[leveloffset=+1]
124130

125131
// Image set configuration examples
126132
include::modules/oc-mirror-image-set-config-examples.adoc[leveloffset=+1]
127133

128-
// TODO: Add an additional resources section to link to the non-TP assembly?
134+
// Command reference for oc-mirror
135+
include::modules/oc-mirror-command-reference.adoc[leveloffset=+1]

modules/oc-mirror-about.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ You can use the oc-mirror OpenShift CLI (`oc`) plug-in to mirror all required {p
1212
* Maintains update paths for {product-title} and Operators.
1313
* Uses a declarative image set configuration file to include only the {product-title} releases, Operators, and images that your cluster needs.
1414
* Performs incremental mirroring, which reduces the size of future image sets.
15+
* Prunes images from the target mirror registry that were excluded from the image set configuration since the previous execution.
16+
* Optionally generates supporting artifacts for OpenShift Update Service (OSUS) usage.
1517
1618
When using the oc-mirror plug-in, you specify which content to mirror in an image set configuration file. In this YAML file, you can fine-tune the configuration to only include the {product-title} releases and Operators that your cluster needs. This reduces the amount of data that you need to download and transfer. The oc-mirror plug-in can also mirror arbitrary helm charts and additional container images to assist users in seamlessly synchronizing their workloads onto mirror registries.
1719

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * installing/disconnected_install/installing-mirroring-disconnected.adoc
4+
5+
:_content-type: REFERENCE
6+
[id="oc-mirror-command-reference_{context}"]
7+
= Command reference for oc-mirror
8+
9+
The following tables describe the `oc mirror` subcommands and flags:
10+
11+
.oc mirror subcommands
12+
[cols="1,2",options="header"]
13+
|===
14+
|Subcommand
15+
|Description
16+
17+
|`completion`
18+
|Generate the autocompletion script for the specified shell.
19+
20+
|`describe`
21+
|Output the contents of an image set.
22+
23+
|`help`
24+
|Show help about any subcommand.
25+
26+
|`init`
27+
|Output an initial image set configuration template.
28+
29+
|`list`
30+
|List available platform and Operator content and their version.
31+
32+
|`version`
33+
|Output the oc-mirror version.
34+
35+
|===
36+
37+
.oc mirror flags
38+
[cols="1,2",options="header"]
39+
|===
40+
|Flag
41+
|Description
42+
43+
|`-c`, `--config` `<string>`
44+
|Specify the path to an image set configuration file.
45+
46+
|`--continue-on-error`
47+
|If any non image-pull related error occurs, continue and attempt to mirror as much as possible.
48+
49+
|`--dest-skip-tls`
50+
|Disable TLS validation for the target registry.
51+
52+
|`--dest-use-http`
53+
|Use plain HTTP for the target registry.
54+
55+
|`--dry-run`
56+
|Print actions without mirroring images. Generates `mapping.txt` and `pruning-plan.json` files.
57+
58+
|`--from <string>`
59+
|Specify the path to an image set archive that was generated by an execution of oc-mirror to load into a target registry.
60+
61+
|`-h`, `--help`
62+
|Show the help.
63+
64+
|`--ignore-history`
65+
|Ignore past mirrors when downloading images and packing layers. Disables incremental mirroring and might download more data.
66+
67+
|`--manifests-only`
68+
|Generate manifests for `ImageContentSourcePolicy` and `CatalogSource` objects to configure a cluster to use the mirror registry, but do not actually mirror any images.
69+
70+
|`--max-per-registry <int>`
71+
|Specify the number of concurrent requests allowed per registry. The default is `6`.
72+
73+
|`--skip-cleanup`
74+
|Skip removal of artifact directories.
75+
76+
|`--skip-image-pin`
77+
|Do not replace image tags with digest pins in Operator catalogs.
78+
79+
|`--skip-metadata-check`
80+
|Skip metadata when publishing an image set. This is only recommended when the image set was created with `--ignore-history`.
81+
82+
|`--skip-missing`
83+
|If an image is not found, skip it instead of reporting an error and aborting execution. Does not apply to custom images explicitly specified in the image set configuration.
84+
85+
|`--skip-verification`
86+
|Skip digest verification.
87+
88+
|`--source-skip-tls`
89+
|Disable TLS validation for the source registry.
90+
91+
|`--source-use-http`
92+
|Use plain HTTP for the source registry.
93+
94+
|`-v`, `--verbose` `<int>`
95+
|Specify the number for the log level verbosity. Valid values are `0` - `9`. The default is `0`.
96+
97+
|===

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

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,58 @@ You must specify a storage backend in the image set configuration file. This sto
1515
Do not delete or modify the metadata that is generated by the oc-mirror plug-in. You must use the same storage backend every time you run the oc-mirror plug-in for the same mirror registry.
1616
====
1717

18+
.Prerequisites
19+
20+
* You have created a container image registry credentials file. For instructions, see _Configuring credentials that allow images to be mirrored_.
21+
1822
.Procedure
1923

20-
. Create an `ImageSetConfiguration` resource that specifies the necessary configuration details:
24+
. 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`:
25+
+
26+
[source,terminal]
27+
----
28+
$ oc mirror init --registry example.com/mirror/oc-mirror-metadata > imageset-config.yaml <1>
29+
----
30+
<1> Replace `example.com/mirror/oc-mirror-metadata` with the location of your registry for the storage backend.
31+
32+
. Edit the file and adjust the settings as necessary:
2133
+
22-
.Example `ImageSetConfiguration` file
2334
[source,yaml]
2435
----
25-
apiVersion: mirror.openshift.io/v1alpha1
2636
kind: ImageSetConfiguration
27-
archiveSize: 4 <1>
37+
apiVersion: mirror.openshift.io/v1alpha2
38+
archiveSize: 4 <1>
39+
storageConfig: <2>
40+
registry:
41+
imageURL: example.com/mirror/oc-mirror-metadata <3>
42+
skipTLS: false
2843
mirror:
29-
ocp:
30-
channels:
31-
- name: stable-4.9 <2>
32-
operators:
33-
- catalog: registry.redhat.io/redhat/redhat-operator-index:v4.9 <3>
34-
storageConfig: <4>
35-
registry:
36-
imageURL: example.com/example/oc-mirror <5>
44+
platform:
45+
channels:
46+
- name: stable-4.11 <4>
47+
type: ocp
48+
graph: true <5>
49+
operators:
50+
- catalog: registry.redhat.io/redhat/redhat-operator-index:v4.11 <6>
51+
packages:
52+
- name: serverless-operator <7>
53+
channels:
54+
- name: stable
55+
additionalImages:
56+
- name: registry.redhat.io/ubi8/ubi:latest <8>
57+
helm: {}
3758
----
38-
<1> The maximum size, in GiB, of each file within the image set.
39-
<2> The channel to retrieve the {product-title} images from.
40-
<3> The Operator catalog to retrieve the {product-title} images from.
41-
<4> The back-end location to save the image set metadata to. This location can be a registry or local directory. It is required to specify `storageConfig` values.
42-
<5> The registry URL for the storage backend.
59+
<1> Add `archiveSize` to set the maximum size, in GiB, of each file within the image set.
60+
<2> Set the back-end location to save the image set metadata to. This location can be a registry or local directory. It is required to specify `storageConfig` values.
61+
<3> Set the registry URL for the storage backend.
62+
<4> Set the channel to retrieve the {product-title} images from.
63+
<5> Add `graph: true` to generate the OpenShift Update Service (OSUS) graph image to allow for an improved cluster update experience when using the web console. For more information, see _About the OpenShift Update Service_.
64+
<6> Set the Operator catalog to retrieve the {product-title} images from.
65+
<7> Specify only certain Operator packages and channels to include in the image set. Remove this field to retrieve all packages in the catalog.
66+
<8> Specify any additional images to include in image set.
4367
+
44-
This example pulls images from the `stable-4.9` channel for the `registry.redhat.io/redhat/redhat-operator-index:v4.9` operator catalog and saves the image set metadata to the `example.com/example/oc-mirror` registry.
68+
See _Image set configuration parameters_ for the full list of parameters and _Image set configuration examples_ for various mirroring use cases.
4569

46-
. Save the file as `imageset-config.yaml`. This file is required by the `oc mirror` command when mirroring content.
70+
. Save the updated file.
71+
+
72+
This image set configuration file is required by the `oc mirror` command when mirroring content.

modules/oc-mirror-differential-updates.adoc

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,27 @@
44

55
:_content-type: PROCEDURE
66
[id="oc-mirror-differential-updates_{context}"]
7-
= Updating your mirror registry
7+
= Updating your mirror registry content
88

9-
After you publish a full image set to the mirror registry, you can use the oc-mirror plug-in to update the mirror registry with updated images.
9+
After you publish the initial image set to the mirror registry, you can use the oc-mirror plug-in to keep your disconnected clusters updated.
1010

11-
When you run the oc-mirror plug-in again, it generates an image set that only contains new and updated images since the previous execution.
12-
13-
[NOTE]
14-
====
15-
You must use the same storage backend as the initial execution of oc-mirror for the same mirror registry. Do not delete or modify the metadata that is generated by the oc-mirror plug-in.
16-
====
17-
18-
Because it only pulls in the differences since the previous image set was created, the generated image set is often smaller and faster to process than the initial image set.
19-
20-
[IMPORTANT]
21-
====
22-
Generated image sets are sequential and must be synchronized to the target mirror registry in order.
23-
====
11+
Depending on your image set configuration, oc-mirror automatically detects newer releases of {product-title} and your selected Operators that have been released after you completed the inital mirror. It is recommended to run oc-mirror at regular intervals, for example in a nightly cron job, to receive product and security updates on a timely basis.
2412

2513
.Prerequisites
2614

2715
* You have used the oc-mirror plug-in to mirror the initial image set to your mirror registry.
2816
* You have access to the storage backend that was used for the initial execution of the oc-mirror plug-in.
17+
+
18+
[NOTE]
19+
====
20+
You must use the same storage backend as the initial execution of oc-mirror for the same mirror registry. Do not delete or modify the metadata image that is generated by the oc-mirror plug-in.
21+
====
2922
3023
.Procedure
3124

32-
. Follow the same steps that you used to create the initial image set and mirror it to the mirror registry. For instructions, see _Mirroring an image set in a partially disconnected environment_ or _Mirroring an image set in a fully disconnected environment_.
25+
. If necessary, update your image set configuration file to pick up new {product-title} and Operator versions. See _Image set configuration examples_ for example mirroring use cases.
26+
27+
. Follow the same steps that you used to mirror your initial image set to the mirror registry. For instructions, see _Mirroring an image set in a partially disconnected environment_ or _Mirroring an image set in a fully disconnected environment_.
3328
+
3429
[IMPORTANT]
3530
====

modules/oc-mirror-disk-to-mirror.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ You can use the oc-mirror plug-in to mirror the contents of a generated image se
2222
+
2323
[source,terminal]
2424
----
25-
$ oc mirror --from=./mirror_seq1_000000.tar \ <1>
26-
docker://registry.example:5000 <2>
25+
$ oc mirror --from=./mirror_seq1_000000.tar \// <1>
26+
docker://registry.example:5000 <2>
2727
----
2828
<1> Pass in the image set .tar file to mirror, named `mirror_seq1_000000.tar` in this example. If an `archiveSize` value was specified in the image set configuration file, the image set might be broken up into multiple .tar files. In this situation, you can pass in a directory that contains the image set .tar files.
2929
<2> Specify the registry to mirror the image set file to. The registry must start with `docker://`. If you specify a top-level namespace for the mirror registry, you must also use this same namespace on subsequent executions.

modules/oc-mirror-dry-run.adoc

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * installing/disconnected_install/installing-mirroring-disconnected.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="oc-mirror-dry-run_{context}"]
7+
= Performing a dry run
8+
9+
You can use oc-mirror to perform a dry run, without actually mirroring any images. This allows you to review the list of images that would be mirrored, as well as any images that would be pruned from the mirror registry. It also allows you to catch any errors with your image set configuration early or use the generated list of images with other tools to carry out the mirroring operation.
10+
11+
.Prerequisites
12+
13+
* You have access to the internet to obtain the necessary container images.
14+
* You have installed the OpenShift CLI (`oc`).
15+
* You have installed the `oc-mirror` CLI plug-in.
16+
* You have created the image set configuration file.
17+
18+
.Procedure
19+
20+
. Run the `oc mirror` command with the `--dry-run` flag to perform a dry run:
21+
+
22+
[source,terminal]
23+
----
24+
$ oc mirror --config=./imageset-config.yaml \// <1>
25+
docker://registry.example:5000 \// <2>
26+
--dry-run <3>
27+
----
28+
<1> Pass in the image set configuration file that was created. This procedure assumes that it is named `imageset-config.yaml`.
29+
<2> Specify the mirror registry. Nothing is mirrored to this registry as long as you use the `--dry-run` flag.
30+
<3> Use the `--dry-run` flag to generate the dry run artifacts and not an actual image set file.
31+
+
32+
.Example output
33+
[source,terminal]
34+
----
35+
Checking push permissions for registry.example:5000
36+
Creating directory: oc-mirror-workspace/src/publish
37+
Creating directory: oc-mirror-workspace/src/v2
38+
Creating directory: oc-mirror-workspace/src/charts
39+
Creating directory: oc-mirror-workspace/src/release-signatures
40+
No metadata detected, creating new workspace
41+
wrote mirroring manifests to oc-mirror-workspace/operators.1658342351/manifests-redhat-operator-index
42+
43+
...
44+
45+
info: Planning completed in 31.48s
46+
info: Dry run complete
47+
Writing image mapping to oc-mirror-workspace/mapping.txt
48+
----
49+
50+
. Navigate into the workspace directory that was generated:
51+
+
52+
[source,terminal]
53+
----
54+
$ cd oc-mirror-workspace/
55+
----
56+
57+
. Review the `mapping.txt` file that was generated.
58+
+
59+
This file contains a list of all images that would be mirrored.
60+
61+
. Review the `pruning-plan.json` file that was generated.
62+
+
63+
This file contains a list of all images that would be pruned from the mirror registry when the image set is published.
64+
+
65+
[NOTE]
66+
====
67+
The `pruning-plan.json` file is only generated if your oc-mirror command points to your mirror registry and there are images to be pruned.
68+
====

0 commit comments

Comments
 (0)