Cloud Experts Documentation

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 StorageClassexternal link (opens in new tab) 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 modeexternal link (opens in new tab) .

Because of that, and for provide Storage with Shared Access (RWX) Access Mode to our OpenShift clusters a GCP Filestoreexternal link (opens in new tab) could be used.

GCP Filestore is not managed neither supported by Red Hat or Red Hat SRE team.

Prerequisites

The GCP Cloud Shellexternal link (opens in new tab) can be used as well and have all the prerequisites installed already.

Steps

  1. From the CLI or GCP Cloud Shell, login within your account and your GCP project:

  2. 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.

  1. After the creation, check the Filestore instance generated in the GCP project:

  2. Extract the ipAddresses from the NFS share for use them into the PV definition:

  3. Login your OSD in GCP cluster

  4. 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)

  1. Check that the PV is generated properly:

  2. Create a PersistentVolumeClaim for this PersistentVolume:

As we can check the storageClassName is empty because we’re using the Static Provisioning in this case.

  1. Check that the PVC is generated properly and with the Bound status:

  2. Generate an example app with more than replicas sharing the same Filestore NFS volume share:

  3. Check that the pods are up && running:

  4. Check that the pods mount the same volume provided by the Filestore NFS share:

Interested in contributing to these docs?

Collaboration drives progress. Help improve our documentation The Red Hat Way.

Red Hat logo LinkedIn YouTube Facebook Twitter

Products

Tools

Try, buy & sell

Communicate

About Red Hat

We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Subscribe to our newsletter, Red Hat Shares

Sign up now
© 2023 Red Hat, Inc.