Most imagestreams in the OpenShift namespace managed by the Samples Operator
point to images located in the Red Hat registry at registry.redhat.io.
The jenkins
, jenkins-agent-maven
, and jenkins-agent-nodejs
imagestreams
come from the install payload and are managed by the Samples
Note
|
The |
-
Access to the cluster as a user with the
cluster-admin
role. -
Create a pull secret for your mirror registry.
-
Access the images of a specific imagestream 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 imagestreams you need
$ oc image mirror registry.redhat.io/rhscl/ruby-25-rhel7:latest ${MIRROR_ADDR}/rhscl/ruby-25-rhel7:latest
-
Add the required trusted CAs for the mirror in the cluster’s image configuration object:
$ oc create configmap registry-config --from-file={MIRROR_ADDR}=$path/ca.crt -n openshift-config $ oc patch image.config.openshift.io/cluster --patch '{"spec":{"additionalTrustedCA":{"name":"registry-config"}}}' --type=merge
-
Update the
samplesRegistry
field in the Samples Operator configuration object to contain thehostname
portion of the mirror location defined in the mirror configuration:$ oc get configs.samples.operator.openshift.io -n openshift-cluster-samples-operator
NoteThis is required because the imagestream import process does not use the mirror or search mechanism at this time.
-
Add any imagestreams that are not mirrored into the
skippedImagestreams
field of the Samples Operator configuration object. Or if you do not want to support any of the sample imagestreams, set the Samples Operator toRemoved
in the Samples Operator configuration object.NoteAny unmirrored imagestreams that are not skipped, or if the Samples Operator is not changed to
Removed
, will result in the Samples Operator reporting aDegraded
status two hours after the imagestream imports start failing.Many of the templates in the OpenShift namespace reference the imagestreams. So using
Removed
to purge both the imagestreams and templates will eliminate the possibility of attempts to use them if they are not functional because of any missing imagestreams.