OpenShift Container Platform provides a built in Container Image Registry which runs as a
standard workload on the cluster. A registry is typically used as a publication target for images
built on the cluster as well as a source of images for workloads running on the cluster.
About this task
Warning: This process does not migrate data from an existing image registry to the new
image registry. If you already have container images in your existing registry, back up your
registry before you complete this process, and re-register your images when this process is
complete.
Before you begin
Be sure that you have the following:
- You have administrative access to OpenShift Web Console.
- Fusion Data Foundation Operator is installed and running in
the
openshift-storage
namespace. In OpenShift Web Console, go to
to view installed operators.
- Image Registry Operator is installed and running in the
openshift-image-registry
namespace. In OpenShift Web Console, go to
to view cluster
operators.
- A storage class with provisioner
openshift-storage.cephfs.csi.ceph.com
available. In OpenShift Web Console, go to
to
view available storage classes.
Procedure
Use the OpenShift Web Console to perform these steps.
- Create a Persistent Volume Claim for the Image Registry to use.
- Go to .
- Set Project to
openshift-image-registry
.
- Click Create Persistent Volume Claims and fill out the
form.
- From the list of available storage classes retrieved above, specify the Storage
Class with the provisioner
openshift-storage.cephfs.csi.ceph.com
.
- Specify the Persistent Volume Claim Name, for example,
ocs4registry
.
- Specify an Access Mode of Shared Access (RWX).
- Specify a Size of at least 100 GB.
- Click Create.
Wait until the status of the new Persistent Volume Claim is listed as
Bound.
- Configure the cluster’s Image Registry to use the new Persistent Volume Claim.
- Go to .
- Click the
Config
custom resource definition associated with the
imageregistry.operator.openshift.io
group.
- From the Instances tab, beside the cluster instance, go to
.
- Add the new Persistent Volume Claim as persistent storage for the Image
Registry.
- If necessary, add the following under spec, replacing
the existing storage section:
storage:
pvc:
claim: <new-pvc-name>
For example: storage:
pvc:
claim: ocs4registry
- Click Save.
- Verify that the new configuration is being used.
- Go to
.
- Set Project to
openshift-image-registry
.
- Verify that the new
image-registry-*
pod appears with a status of
Running and that the previous image-registry-*
pod
terminates.
- Click the new
image-registry-*
pod to view pod
details.
- From Volumes verify that the
registry-storage
volume has a Type that matches your new Persistent Volume Claim. For example,
ocs4registry
.