Adding persistent storage with NFS
After installing the cluster, by default, all the container images that are pulled from the remote registries are stored locally in memory. That means if the registry pod is restarted all these images will be lost. Since Red Hat OpenShift Container Platform is running on IBM Z and IBM® LinuxONE, you need to use persistent storage to store the container images on a persistent volume.
Persistent storage can be local storage that is attached directly to the hypervisor and made available to the cluster, or network-attached storage such as NFS or IBM Spectrum Scale.
The following sections show how to add persistent storage to the RHOCP image registry, first by using the RHOCP user interface (UI) and later also using the RHOCP CLI.
Preparing the NFS server
The first thing to do is to set up an NFS server in the network. For testing purposes, the NFS server using RHEL can be used. Alternatively, you can use any other Linux distribution or appliance as well as a storage device that provides NFS shares.
An NFS server must be installed and configured with firewall rules enabled. Refer to the official documentation for detailed technical instructions on setting up and configuring NFS: Mounting NFS shares in the RHEL documentation.
Requirements
- The minimum requirement for the RHOCP image registry is 100Gi. For this example, a disk volume of 100Gi has been added and mounted to the NFS server under the directory /mnt/ocp4-registry.
- To make the setting permanent, ensure that it is configured in the /etc/fstab.
- The file /etc/exports contains a table of local physical file systems on an NFS server that are accessible to NFS clients
Adding persistent storage with NFS
When the NFS server is configured the RHOCP User Interface or the RHOCP CLI can be used to create the persistent volumes. The following steps summarize the process:
- Create a Persistent Volume by using the RHOCP web console.
- Create a Persistent Volume Claim by using the RHOCP web console (make sure the project "openshift-image-registry" is selected) .
- Edit the operator to use the new NFS configuration.
See Dynamic persistent storage using NFS for examples using the CLI.