Create Filestore Storage for OSD in GCP
This content is authored by Red Hat experts, but has not yet been tested on every supported configuration.
By default, within OSD in GCP only the GCE-PD StorageClass is available in the cluster. With this StorageClass, only ReadWriteOnce mode is permitted, and the gcePersistentDisks can only be mounted by a single consumer in read-write mode .
Because of that, and for provide Storage with Shared Access (RWX) Access Mode to our OpenShift clusters a GCP Filestore could be used.
GCP Filestore is not managed neither supported by Red Hat or Red Hat SRE team.
Prerequisites
The GCP Cloud Shell can be used as well and have all the prerequisites installed already.
Steps
From the CLI or GCP Cloud Shell, login within your account and your GCP project:
Create a Filestore instance in GCP:
Due to the Static Provisioning through the creation of the PV/PVC the Filestore for the RWX storage needs to be created upfront.
After the creation, check the Filestore instance generated in the GCP project:
Extract the ipAddresses from the NFS share for use them into the PV definition:
Login your OSD in GCP cluster
Create a Persistent Volume using the NFS_IP of the Filestore as the nfs server into the PV definition, specifying the path of the shared Filestore:
As you can check the PV is generated with the accessMode of ReadWriteMany (RWX)
Check that the PV is generated properly:
Create a PersistentVolumeClaim for this PersistentVolume:
As we can check the storageClassName is empty because we’re using the Static Provisioning in this case.
Check that the PVC is generated properly and with the Bound status:
Generate an example app with more than replicas sharing the same Filestore NFS volume share:
Check that the pods are up && running:
Check that the pods mount the same volume provided by the Filestore NFS share: