Use Cluster Samples Operator image streams with alternate or mirrored registries
You can use an alternate or mirror registry to host your images streams instead of using the Red Hat registry.
Most image streams in the openshift namespace managed by the Cluster Samples Operator point to images located in the Red Hat registry at registry.redhat.io.
|
|
The |
|
|
The Cluster Samples Operator must be set to |
-
Access to the cluster as a user with the
cluster-adminrole. -
Create a pull secret for your mirror registry.
-
Access the images of a specific image stream to mirror, for example:
$ oc get is <imagestream> -n openshift -o json | jq .spec.tags[].from.name | grep registry.redhat.io -
Mirror images from registry.redhat.io associated with any image streams you need
$ oc image mirror registry.redhat.io/rhscl/ruby-25-rhel7:latest ${MIRROR_ADDR}/rhscl/ruby-25-rhel7:latest -
Create the image configuration object for the cluster by running the following command:
$ oc create configmap registry-config --from-file=${MIRROR_ADDR_HOSTNAME}..5000=$path/ca.crt -n openshift-config -
Add the required trusted CAs for the mirror in the image configuration object:
$ oc patch image.config.openshift.io/cluster --patch '{"spec":{"additionalTrustedCA":{"name":"registry-config"}}}' --type=merge -
Update the
samplesRegistryfield in the Cluster Samples Operator configuration object to contain thehostnameportion of the mirror location defined in the mirror configuration:$ oc edit configs.samples.operator.openshift.io -n openshift-cluster-samples-operatorThis step is required because the image stream import process does not use the mirror or search mechanism at this time.
-
Add any image streams that are not mirrored into the
skippedImagestreamsfield of the Cluster Samples Operator configuration object. Or if you do not want to support any of the sample image streams, set the Cluster Samples Operator toRemovedin the Cluster Samples Operator configuration object.The Cluster Samples Operator issues alerts if image stream imports are failing but the Cluster Samples Operator is either periodically retrying or does not appear to be retrying them.
Many of the templates in the
openshiftnamespace reference the image streams. You can useRemovedto purge both the image streams and templates. This eliminates the possibility of attempts to use the templates if they are not functional because of any missing image streams.