Adding dynamic persistent storage with NFS
This section discusses how to set up NFS and RHOCP to provide a dynamic allocation of persistent volumes to workloads running on the cluster. This approach uses a Storage Class and explains how to configure RHOCP to use a default storage class.
Next, a simple application is deployed to demonstrate the dynamic allocation of storage to the deployment. Dynamic provisioning (Red Hat documentation) defines what a storage class is and how it relates to dynamic provisioning:
TheStorageClassresource object describes and classifies storage that can be requested, as well as provides a means for passing parameters for dynamically provisioned storage on demand.StorageClassobjects can also serve as a management mechanism for controlling different levels of storage and access to the storage. Cluster Administrators (cluster-admin) or Storage Administrators (storage-admin) define and create theStorageClassobjects that users can request without needing any intimate knowledge about the underlying storage volume sources. The Red Hat OpenShift Container Platform persistent volume framework enables this function and allows administrators to provision a cluster with persistent storage. The framework also gives users a way to request those resources without having any knowledge of the underlying infrastructure.
The following Persistent storage examples show how to add dynamic persistent storage with NFS.
- Define the NFS directories for each persistent storage definition
- Add the directories that are created to the NFS exports configuration
- Create the storage class and define it as the default one
- Create the persistent volumes that use the NFS directories, which were created in the first step.
- Deploy a test application to use the dynamic storage. Note: For applications that require persistent storage during the deployment, such as databases , the allocation of the persistent storage should happen during the deployment using this configuration.
For further details and technical details, see: Persistent Storage Part II: Dynamic NFS Provisioning for OpenShift 4.3 on IBM Z and LinuxONE(LinkedIn)