Google Compute Platform Filestore CSI Driver Operator

    Familiarity with and configuring CSI volumes is recommended when working with a CSI Operator and driver.

    To create CSI-provisioned PVs that mount to GCP Filestore Storage assets, you install the GCP Filestore CSI Driver Operator and the GCP Filestore CSI driver in the namespace.

    • The GCP Filestore CSI Driver Operator does not provide a storage class by default, but . The GCP Filestore CSI Driver Operator supports dynamic volume provisioning by allowing storage volumes to be created on demand, eliminating the need for cluster administrators to pre-provision storage.

    • The GCP Filestore CSI driver enables you to create and mount GCP Filestore PVs.

    About CSI

    Storage vendors have traditionally provided storage drivers as part of Kubernetes. With the implementation of the Container Storage Interface (CSI), third-party providers can instead deliver storage plugins using a standard interface without ever having to change the core Kubernetes code.

    CSI Operators give OKD users storage options, such as volume snapshots, that are not possible with in-tree volume plugins.

    The Google Compute Platform (GCP) Filestore Container Storage Interface (CSI) Driver Operator is not installed in OKD by default. Use the following procedure to install the GCP Filestore CSI Driver Operator in your cluster.

    Prerequisites

    • Access to the OKD web console.

    Procedure

    To install the GCP Filestore CSI Driver Operator from the web console:

    1. Log in to the web console.

    2. Enable the Filestore API in the GCE project by running the following command:

      You can also do this using Google Cloud web console.

    3. Install the GCP Filestore CSI Operator:

      1. Locate the GCP Filestore CSI Operator by typing GCP Filestore in the filter box.

      2. On the GCP Filestore CSI Driver Operator page, click Install.

      3. On the Install Operator page, ensure that:

        • All namespaces on the cluster (default) is selected.

        • Installed Namespace is set to openshift-cluster-csi-drivers.

      4. Click Install.

        After the installation finishes, the GCP Filestore CSI Operator is listed in the Installed Operators section of the web console.

    4. Install the GCP Filestore CSI Driver:

      1. Click administrationCustomResourceDefinitionsClusterCSIDriver.

      2. On the Instances tab, click Create ClusterCSIDriver.

        Use the following YAML file:

        1. apiVersion: operator.openshift.io/v1
        2. kind: ClusterCSIDriver
        3. name: filestore.csi.storage.gke.io
        4. spec:
        5. managementState: Managed
      3. Wait for the following Conditions to change to a “true” status:

        • GCPFilestoreDriverCredentialsRequestControllerAvailable

        • GCPFilestoreDriverNodeServiceControllerAvailable

    Additional resources

    Creating a storage class for GCP Filestore Storage

    After installing the Operator, you should create a storage class for dynamic provisioning of Google Compute Platform (GCP) Filestore volumes.

    Prerequisites

    • You are logged in to the running OKD cluster.

    Procedure

    To create a storage class:

    1. Create a storage class using the following example YAML file:

      Example YAML file

    2. Specify the name of the VPC network where Filestore instances should be created in.

      It is recommended to specify the VPC network that the Filestore instances should be created in. If no VPC network is specified, the Container Storage Interface (CSI) driver tries to create the instances in the default VPC network of the project. On IPI installations, the VPC network name is typically the cluster name with the suffix “-network”. However, on UPI installations, the VPC network name can be any value chosen by the user.

      You can find out the VPC network name by inspecting the objects with the following command:

      1. $ oc -n openshift-machine-api get machinesets -o yaml | grep "network:"
      2. - network: gcp-filestore-network
      3. (...)

      In this example, the VPC network name in this cluster is “gcp-filestore-network”.

    Typically, if you destroy a cluster, the OKD installer deletes all of the cloud resources that belong to that cluster. However, when a cluster is destroyed, Google Compute Platform (GCP) Filestore instances are not automatically deleted, so you must manually delete all persistent volume claims (PVCs) that use the Filestore storage class before destroying the cluster.

    Procedure

    To delete all GCP Filestore PVCs:

    1. Delete all of the PVCs listed by the previous command:

      Additional resources