Image registry removed during installation

On platforms that do not provide shareable object storage, the OpenShift Image Registry Operator bootstraps itself as Removed. This allows openshift-installer to complete installations on these platform types.

After installation, you must edit the Image Registry Operator configuration to switch the managementState from Removed to Managed.

The Prometheus console provides an ImageRegistryRemoved alert, for example:

"Image Registry has been removed. ImageStreamTags, BuildConfigs and DeploymentConfigs which reference ImageStreamTags may not work as expected. Please configure storage and update the config to Managed state by editing"

Changing the image registry’s management state

To start the image registry, you must change the Image Registry Operator configuration’s managementState from Removed to Managed.

  • Change managementState Image Registry Operator configuration from Removed to Managed. For example:

    $ oc patch cluster --type merge --patch '{"spec":{"managementState":"Managed"}}'

Image registry storage configuration

The image-registry Operator is not initially available for platforms that do not provide default storage. After installation, you must configure your registry to use storage so that the Registry Operator is made available.

Instructions are shown for configuring a PersistentVolume, which is required for production clusters. Where applicable, instructions are shown for configuring an empty directory as the storage location, which is available for only non-production clusters.

Additional instructions are provided for allowing the image registry to use block storage types by using the Recreate rollout strategy during upgrades.

Configuring registry storage for bare metal

As a cluster administrator, following installation you must configure your registry to use storage.

  • Cluster administrator permissions.

  • A cluster on bare metal.

  • Provisioned persistent storage for your cluster, such as Red Hat OpenShift Container Storage. To deploy a private image registry, your storage must provide ReadWriteMany access mode.

  • Must have "100Gi" capacity.

  1. To configure your registry to use storage, change the in the configs.imageregistry/cluster resource.

    When using shared storage such as NFS, it is strongly recommended to use the supplementalGroups strategy, which dictates the allowable supplemental groups for the Security Context, rather than the fsGroup ID. Refer to the NFS Group IDs documentation for details.

  2. Verify you do not have a registry Pod:

    $ oc get pod -n openshift-image-registry
    • If the storage type is emptyDIR, the replica number cannot be greater than 1.

    • If the storage type is NFS, you must enable the no_wdelay and root_squash mount options. For example:

      # cat /etc/exports
      Example output
      /mnt/data *(rw,sync,no_wdelay,root_squash,insecure,fsid=0)
      sh-4.2# exportfs -rv
      Example output
      exporting *:/mnt/data
  3. Check the registry configuration:

    $ oc edit
    Example registry configuration

    Leave the claim field blank to allow the automatic creation of an image-registry-storage PVC.

  4. Check the clusteroperator status:

    $ oc get clusteroperator image-registry

See Group IDs for additional details about using supplemental groups to handle NFS access.

Configuring storage for the image registry in non-production clusters

You must configure storage for the image registry Operator. For non-production clusters, you can set the image registry to an empty directory. If you do so, all images are lost if you restart the registry.

  1. To set the image registry storage to an empty directory:

    $ oc patch cluster --type merge --patch '{"spec":{"storage":{"emptyDir":{}}}}'

    Configure this option for only non-production clusters.

    If you run this command before the Image Registry Operator initializes its components, the oc patch command fails with the following error:

    Error from server (NotFound): "cluster" not found

    Wait a few minutes and run the command again.

  2. Ensure that your registry is set to managed to enable building and pushing of images.

    • Run:

      $ oc edit configs.imageregistry/cluster

      Then, change the line

      managementState: Removed


      managementState: Managed

Additional resources

For more details about configuring registry storage for bare metal, see Recommended configurable storage technology.