1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/hcp-dc-image-mirror.adoc
2025-12-04 15:03:18 +00:00

117 lines
4.7 KiB
Plaintext

// Module included in the following assemblies:
//
// * hosted_control_planes/hcp-disconnected/hcp-deploy-dc-bm.adoc
// * hosted_control_planes/hcp-disconnected/hcp-deploy-dc-virt.adoc
:_mod-docs-content-type: PROCEDURE
[id="hcp-dc-image-mirror_{context}"]
= Configuring image mirroring for {hcp} in a disconnected environment
Image mirroring is the process of fetching images from external registries, such as `registry.redhat.com` or `quay.io`, and storing them in your private registry.
In the following procedures, the `oc-mirror` tool is used, which is a binary that uses the `ImageSetConfiguration` object. In the file, you can specify the following information:
* The {product-title} versions to mirror. The versions are in `quay.io`.
* The additional Operators to mirror. Select packages individually.
* The extra images that you want to add to the repository.
.Prerequisites
* Ensure that the registry server is running before you start the mirroring process.
.Procedure
To configure image mirroring, complete the following steps:
. Ensure that your `${HOME}/.docker/config.json` file is updated with the registries that you are going to mirror from and with the private registry that you plan to push the images to.
. By using the following example, create an `ImageSetConfiguration` object to use for mirroring. Replace values as needed to match your environment:
+
[source,yaml,subs="attributes+"]
----
apiVersion: mirror.openshift.io/v2alpha1
kind: ImageSetConfiguration
mirror:
platform:
channels:
- name: candidate-{product-version}
minVersion: <4.x.y-build> <1>
maxVersion: <4.x.y-build> <1>
type: ocp
kubeVirtContainer: true <2>
graph: true
operators:
- catalog: registry.redhat.io/redhat/redhat-operator-index:v{product-version}
packages:
- name: lvms-operator
- name: local-storage-operator
- name: odf-csi-addons-operator
- name: odf-operator
- name: mcg-operator
- name: ocs-operator
- name: metallb-operator
- name: kubevirt-hyperconverged <3>
----
+
<1> Replace `<4.x.y-build>` with the supported {product-title} version you want to use.
<2> Set this optional flag to `true` if you want to also mirror the container disk image for the {op-system-first} boot image for the KubeVirt provider. This flag is available with oc-mirror v2 only.
<3> For deployments that use the KubeVirt provider, include this line.
. Start the mirroring process by entering the following command:
+
[source,terminal]
----
$ oc-mirror --v2 --config imagesetconfig.yaml \
--workspace file://mirror-file docker://<registry>
----
+
After the mirroring process is finished, you have a new folder named `mirror-file`, which contains the `ImageDigestMirrorSet` (IDMS), `ImageTagMirrorSet` (ITMS), and the catalog sources to apply on the hosted cluster.
. Mirror the nightly or CI versions of {product-title} by configuring the `imagesetconfig.yaml` file as follows:
+
[source,yaml]
----
apiVersion: mirror.openshift.io/v2alpha1
kind: ImageSetConfiguration
mirror:
platform:
graph: true
release: registry.ci.openshift.org/ocp/release:<4.x.y-build> <1>
kubeVirtContainer: true <2>
# ...
----
+
<1> Replace `<4.x.y-build>` with the supported {product-title} version you want to use.
<2> Set this optional flag to `true` if you want to also mirror the container disk image for the {op-system-first} boot image for the KubeVirt provider. This flag is available with oc-mirror v2 only.
. If you have a partially disconnected environment, mirror the images from the image set configuration to a registry by entering the following command:
+
[source,terminal]
----
$ oc mirror -c imagesetconfig.yaml \
--workspace file://<file_path> docker://<mirror_registry_url> --v2
----
+
For more information, see "Mirroring an image set in a partially disconnected environment".
. If you have a fully disconnected environment, perform the following steps:
.. Mirror the images from the specified image set configuration to the disk by entering the following command:
+
[source,terminal]
----
$ oc mirror -c imagesetconfig.yaml file://<file_path> --v2
----
+
For more information, see "Mirroring an image set in a fully disconnected environment".
.. Process the image set file on the disk and mirror the contents to a target mirror registry by entering the following command:
+
[source,terminal]
----
$ oc mirror -c imagesetconfig.yaml \
--from file://<file_path> docker://<mirror_registry_url> --v2
----
. Mirror the latest {mce-short} images by following the steps in link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.15/html/clusters/cluster_mce_overview#install-on-disconnected-networks[Install on disconnected networks].