$ oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"managementState":"Managed"}}'
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 "Image Registry has been removed. |
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 configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"managementState":"Managed"}}'
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 the Registry Operator is made available.
Instructions for both configuring a PersistentVolume, which is required for production clusters, and for configuring an empty directory as the storage location, which is available for only non-production clusters, are shown.
As a cluster administrator, following installation you must configure your registry to use storage.
Cluster administrator permissions.
A cluster on bare metal.
Provision 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.
To configure your registry to use storage, change the spec.storage.pvc
in
the configs.imageregistry/cluster
resource.
When using shared storage such as NFS, it is strongly recommended to use the |
Verify you do not have a registry Pod:
$ oc get pod -n openshift-image-registry
|
Check the registry configuration:
$ oc edit configs.imageregistry.operator.openshift.io storage: pvc: claim:
Leave the claim
field blank to allow the automatic creation of an
image-registry-storage
PVC.
Check the clusteroperator
status:
$ oc get clusteroperator image-registry
See Group IDs for additional details about using supplemental groups to handle NFS access.
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.
To set the image registry storage to an empty directory:
$ oc patch configs.imageregistry.operator.openshift.io 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): configs.imageregistry.operator.openshift.io "cluster" not found
Wait a few minutes and run the command again.
For more details about configuring registry storage for bare metal, see Recommended configurable storage technology.