Configuring the hub cluster to use a disconnected mirror registry
You can configure the hub cluster to use a disconnected mirror registry for a disconnected environment.
-
You have a disconnected hub cluster installation with Red Hat Advanced Cluster Management (RHACM) 2.17 installed.
-
You have hosted the
rootfsandisoimages on an HTTP server. See the Additional resources section for guidance about Mirroring the OpenShift Container Platform image repository.
|
|
If you enable TLS for the HTTP server, you must confirm the root certificate is signed by an authority trusted by the client and verify the trusted certificate chain between your OpenShift Container Platform hub and managed clusters and the HTTP server. Using a server configured with an untrusted certificate prevents the images from being downloaded to the image creation service. Using untrusted HTTPS servers is not supported. |
-
Create a
ConfigMapcontaining the mirror registry config:apiVersion: v1 kind: ConfigMap metadata: name: assisted-installer-mirror-config namespace: multicluster-engine labels: app: assisted-service data: ca-bundle.crt: | -----BEGIN CERTIFICATE----- <certificate_contents> -----END CERTIFICATE----- registries.conf: | unqualified-search-registries = ["registry.access.redhat.com", "docker.io"] [[registry]] prefix = "" location = "quay.io/example-repository" mirror-by-digest-only = true [[registry.mirror]] location = "mirror1.registry.corp.com:5000/example-repository"where:
namespace: multicluster-engine-
The
ConfigMapnamespace must be set tomulticluster-engine. ca-bundle.crt-
The mirror registry’s certificate that is used when creating the mirror registry.
registries.conf-
The configuration file for the mirror registry. The mirror registry configuration adds mirror information to the
/etc/containers/registries.conffile in the discovery image. The mirror information is stored in theimageContentSourcessection of theinstall-config.yamlfile when the information is passed to the installation program. The Assisted Service pod that runs on the hub cluster fetches the container images from the configured mirror registry. location = "quay.io/example-repository"-
The URL of the mirror registry. You must use the URL from the
imageContentSourcessection by running theoc adm release mirrorcommand when you configure the mirror registry. For more information, see the Mirroring the OpenShift Container Platform image repository section. location = "mirror1.registry.corp.com:5000/example-repository"-
The registries defined in the
registries.conffile must be scoped by repository, not by registry. In this example, both thequay.io/example-repositoryand themirror1.registry.corp.com:5000/example-repositoryrepositories are scoped by theexample-repositoryrepository.
This updates
mirrorRegistryRefin theAgentServiceConfigcustom resource, as shown in this example output:apiVersion: agent-install.openshift.io/v1beta1 kind: AgentServiceConfig metadata: name: agent namespace: multicluster-engine spec: databaseStorage: volumeName: <db_pv_name> accessModes: - ReadWriteOnce resources: requests: storage: <db_storage_size> filesystemStorage: volumeName: <fs_pv_name> accessModes: - ReadWriteOnce resources: requests: storage: <fs_storage_size> mirrorRegistryRef: name: assisted-installer-mirror-config osImages: - openshiftVersion: <ocp_version> url: <iso_url>where:
namespace: multicluster-engine-
Set the
AgentServiceConfignamespace tomulticluster-engineto match theConfigMapnamespace. assisted-installer-mirror-config-
Set
mirrorRegistryRef.nameto match the definition specified in the relatedConfigMapCR. <ocp_version>-
Set the OpenShift Container Platform version to either the x.y or x.y.z format.
<iso_url>-
Set the URL for the ISO hosted on the
httpdserver.
A valid NTP server is required during cluster installation. Ensure that a suitable NTP server is available and can be reached from the installed clusters through the disconnected network.