Widening the scope of the mirror image catalog to reduce the frequency of cluster node reboots
You can scope the mirrored image catalog at the repository level or the wider registry level. A widely scoped ImageContentSourcePolicy resource reduces the number of times the nodes need to reboot in response to changes to the resource.
To widen the scope of the mirror image catalog in the ImageContentSourcePolicy resource, perform the following procedure.
-
Install the Red Hat OpenShift Container Platform CLI
oc. -
Log in as a user with
cluster-adminprivileges. -
Configure a mirrored image catalog for use in your disconnected cluster.
-
Run the following command, specifying values for
<local_registry>,<pull_spec>, and<pull_secret_file>:$ oc adm catalog mirror <local_registry>/<pull_spec> <local_registry> -a <pull_secret_file> --icsp-scope=registrywhere:
- <local_registry>
-
is the local registry you have configured for your disconnected cluster, for example,
local.registry:5000. - <pull_spec>
-
is the pull specification as configured in your disconnected registry, for example,
redhat/redhat-operator-index:v{product-version} - <pull_secret_file>
-
is the
registry.redhat.iopull secret in.jsonfile format. You can download the pull secret from Red Hat OpenShift Cluster Manager.
The
oc adm catalog mirrorcommand creates a/redhat-operator-index-manifestsdirectory and generatesimageContentSourcePolicy.yaml,catalogSource.yaml, andmapping.txtfiles. -
Apply the new
ImageContentSourcePolicyresource to the cluster:$ oc apply -f imageContentSourcePolicy.yaml
-
Verify that
oc applysuccessfully applied the change toImageContentSourcePolicy:$ oc get ImageContentSourcePolicy -o yamlExample outputapiVersion: v1 items: - apiVersion: operator.openshift.io/v1alpha1 kind: ImageContentSourcePolicy metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"operator.openshift.io/v1alpha1","kind":"ImageContentSourcePolicy","metadata":{"annotations":{},"name":"redhat-operator-index"},"spec":{"repositoryDigestMirrors":[{"mirrors":["local.registry:5000"],"source":"registry.redhat.io"}]}} ...
After you update the ImageContentSourcePolicy resource, Red Hat OpenShift Container Platform deploys the new settings to each node and the cluster starts using the mirrored repository for requests to the source repository.