Skip to content

Commit a1dcf87

Browse files
authored
Merge pull request #59481 from skopacz1/OCPBUGS-10810
OCPBUGS-10810: oc-mirror example in agent docs
2 parents 60a6167 + 1e9408d commit a1dcf87

File tree

3 files changed

+77
-26
lines changed

3 files changed

+77
-26
lines changed

installing/installing_with_agent_based_installer/understanding-disconnected-installation-mirroring.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ You can use one of the following procedures to mirror your {product-title} image
1818
* xref:../../installing/disconnected_install/installing-mirroring-disconnected.adoc#installing-mirroring-disconnected[Mirroring images for a disconnected installation using the oc-mirror plugin]
1919

2020
include::modules/agent-install-about-mirroring-for-disconnected-registry.adoc[leveloffset=+1]
21+
22+
include::modules/agent-install-configuring-for-disconnected-registry.adoc[leveloffset=+2]

modules/agent-install-about-mirroring-for-disconnected-registry.adoc

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
To use mirror images for a disconnected installation with the Agent-based Installer, you must modify the `install-config.yaml` file.
1212

1313
You can mirror the release image by using the output of either the `oc adm release mirror` or `oc mirror` command.
14-
This is dependent on which command you used to set up the mirror registry. The following example shows the output of the `oc adm release mirror` command.
14+
This is dependent on which command you used to set up the mirror registry.
1515

16+
The following example shows the output of the `oc adm release mirror` command.
1617

1718
[source,terminal]
1819
----
@@ -35,35 +36,21 @@ mirrors:
3536
virthost.ostest.test.metalkube.org:5000/localimages/local-release-image
3637
source: registry.ci.openshift.org/ocp/release
3738
----
38-
Use the output of the command to update the `imageContentSources` field in the `install-config.yaml` file. Additionally, add the certificate file used for the mirror registry to the `additionalTrustBundle` field.
3939

40-
.Example `install-config.yaml` file
40+
The following example shows part of the `imageContentSourcePolicy.yaml` file generated by the oc-mirror plugin. The file can be found in the results directory, for example `oc-mirror-workspace/results-1682697932/`.
41+
42+
.Example `imageContentSourcePolicy.yaml` file
4143

4244
[source,yaml]
4345
----
44-
additionalTrustBundle: |
45-
-----BEGIN CERTIFICATE-----
46-
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
47-
-----END CERTIFICATE-----
46+
spec:
47+
repositoryDigestMirrors:
48+
- mirrors:
49+
- virthost.ostest.test.metalkube.org:5000/openshift/release
50+
source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
51+
- mirrors:
52+
- virthost.ostest.test.metalkube.org:5000/openshift/release-images
53+
source: quay.io/openshift-release-dev/ocp-release
4854
----
4955

50-
The value must be the contents of the certificate file that you used for your mirror registry. The certificate file can be an existing, trusted certificate authority, or the self-signed certificate that you generated for the mirror registry.
51-
52-
If you are using the optional method of the {ztp} manifests, there are two mirror configuration files: `registries.conf` and `ca- bundle.crt` . These files must be added to the `mirror/directory` path to add the mirror configuration in the agent ISO image.
53-
54-
You can create the `registries.conf` file from the output of either the `oc adm release mirror` or `oc mirror` command. The format of the `/etc/containers/registries.conf` file has changed . It is now version 2 and in TOML format.
5556

56-
.Example `registries.conf` file
57-
58-
[source,toml]
59-
----
60-
[[registry]]
61-
location = "registry.ci.openshift.org/ocp/release" mirror-by-digest-only = true
62-
63-
[[registry.mirror]] location = "virthost.ostest.test.metalkube.org:5000/localimages/local-release-image"
64-
65-
[[registry]]
66-
location = "quay.io/openshift-release-dev/ocp-v4.0- art-dev" mirror-by-digest-only = true
67-
68-
[[registry.mirror]] location = "virthost.ostest.test.metalkube.org:5000/localimages/local-release-image"
69-
----
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * installing/installing_with_agent_based_installer/understanding-disconnected-installation-mirroring.adoc
4+
5+
:_content-type: Procedure[id="agent-install-configuring-for-disconnected-registry_{context}"]
6+
= Configuring the Agent-based Installer to use mirrored images
7+
8+
You must use the output of either the `oc adm release mirror` command or the oc-mirror plugin to configure the Agent-based Installer to use mirrored images.
9+
10+
.Procedure
11+
12+
. If you used the oc-mirror plugin to mirror your release images:
13+
14+
.. Open the `imageContentSourcePolicy.yaml` located in the results directory, for example `oc-mirror-workspace/results-1682697932/`.
15+
16+
.. Copy the text in the `repositoryDigestMirrors` section of the yaml file.
17+
18+
. If you used the `oc adm release mirror` command to mirror your release images:
19+
20+
* Copy the text in the `imageContentSources` section of the command output.
21+
22+
. Paste the copied text into the `imageContentSources` field of the `install-config.yaml` file.
23+
24+
. Add the certificate file used for the mirror registry to the `additionalTrustBundle` field of the yaml file.
25+
+
26+
[IMPORTANT]
27+
====
28+
The value must be the contents of the certificate file that you used for your mirror registry.
29+
The certificate file can be an existing, trusted certificate authority, or the self-signed certificate that you generated for the mirror registry.
30+
====
31+
+
32+
.Example `install-config.yaml` file
33+
34+
[source,yaml]
35+
----
36+
additionalTrustBundle: |
37+
-----BEGIN CERTIFICATE-----
38+
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
39+
-----END CERTIFICATE-----
40+
----
41+
42+
. If you are using {ztp} manifests: add the `registries.conf` and `ca-bundle.crt` files to the `mirror` path to add the mirror configuration in the agent ISO image.
43+
+
44+
[NOTE]
45+
====
46+
You can create the `registries.conf` file from the output of either the `oc adm release mirror` command or the `oc mirror` plugin. The format of the `/etc/containers/registries.conf` file has changed. It is now version 2 and in TOML format.
47+
====
48+
+
49+
.Example `registries.conf` file
50+
51+
[source,toml]
52+
----
53+
[[registry]]
54+
location = "registry.ci.openshift.org/ocp/release" mirror-by-digest-only = true
55+
56+
[[registry.mirror]] location = "virthost.ostest.test.metalkube.org:5000/localimages/local-release-image"
57+
58+
[[registry]]
59+
location = "quay.io/openshift-release-dev/ocp-v4.0-art-dev" mirror-by-digest-only = true
60+
61+
[[registry.mirror]] location = "virthost.ostest.test.metalkube.org:5000/localimages/local-release-image"
62+
----

0 commit comments

Comments
 (0)