Enabling the Red Hat OpenShift internal image registry

The Image Registry Operator installs a single instance of the Red Hat® OpenShift® Container Platform registry, and manages all registry configuration, including setting up registry storage. Storage is only automatically configured when you install an installer-provisioned infrastructure cluster on Amazon Web Services, GCP, and Microsoft Azure, and thus you can use the internal image registry directly. But for bare metal and vSphere Red Hat OpenShift cluster, you must manually enable the Red Hat OpenShift internal image registry so that it is used by Maximo® Application Suite and its applications.

You can enable the Red Hat OpenShift internal image registry by using the existing Red Hat OpenShift Container Storage.

Enabling the Red Hat OpenShift internal image registry by using the existing Red Hat OpenShift Container Storage

If you already have Red Hat OpenShift Container Storage running inside your Red Hat OpenShift Container Platform, you can run the following steps in the bastion server and use OCS storage for the internal image registry.

Procedure

  1. Create PVC for internal Registry use.
    
    oc project openshift-image-registry
    
    
    oc create -f <(echo '{
       "apiVersion": "v1",
       "kind": "PersistentVolumeClaim",
       "metadata": {
         "name": "image-registry-storage"
       },
       "spec": {
         "storageClassName": "ocs-storagecluster-cephfs",
         "accessModes": [ "ReadWriteMany" ],
         "resources": {
           "requests": { "storage": "500Gi"
         }
       }
     }
    }');
    
  2. Update the Registry CR spec with the following command.
    
    oc edit configs.imageregistry.operator.openshift.io -n openshift-image-registry
    
  3. Change spec.managementState from Removed to Managed.
  4. Change spec.storage from {} to:
    
    spec:
        managementState: Managed
    storage:
          pvc:
            claim: image-registry-storage
    
  5. Save and quit.
  6. Check that the image registry is available.
    
    oc get co image-registry
    
  7. Enable the external route.
    
    oc -n openshift-image-registry patch configs.imageregistry.operator.openshift.io/cluster 
     --patch '{"spec":{"defaultRoute":true}}' --type=merge