Using Cloud Filestore

Using Cloud Filestore with Kubeflow

This guide describes how to set up and use Cloud Filestore with Kubeflow on Google Cloud Platform (GCP).

About Cloud Filestore

Cloud File Store is a fully managed NFS offering. Cloud Filestore is very useful for creating a shared filesystem that can be mounted into pods such as Jupyter.

Before you start

This guide assumes you have already set up Kubeflow on GCP. If you haven’t done so, follow the guide to deploying Kubeflow on GCP.

The instructions below assume that the ${KFAPP} environment variable contains the name (not the full path) of the directory containing your Kubeflow configurations. See the Kubeflow deployment guide for details of this directory.

Create a Cloud Filestore instance

Follow these instructions to create a Cloud Filestore instance; if you already have a Cloud Filestore instance you want to use you can skip this section.

Copy the Cloud Filestore deployment manager configs to the gcp_config directory:

cd /<path-to-kubeflow-deployment>/${KFAPP}
cp .cache/${VERSION}/deployment/gke/deployment_manager_configs/gcfs.yaml \

Edit gcfs.yaml to match your desired configuration:

  • Set zone
  • Set name
  • Set the value of parent to include your project e.g.


Using yq:

cd /<path-to-kubeflow-deployment>/${KFAPP}
yq -r ".resources[0].properties.instanceId=\"${DEPLOYMENT_NAME}\"" gcp_config/gcfs.yaml > gcp_config/
mv gcp_config/ gcp_config/gcfs.yaml

Apply the changes:

cd /<path-to-kubeflow-deployment>/${KFAPP}/gcp_config
gcloud --project=${PROJECT} deployment-manager deployments create ${KFAPP-NAME}-nfs --config=gcfs.yaml

If you get an error legacy networks are not supported follow the instructions in the troubleshooting guide.

Create a PVC to mount the filestore.

Create a PVC for Cloud Filestore instance.

Run the following command to get the ip address of the cloud file store instance

gcloud --project=${PROJECT} filestore instances list

The output will be something like the following and give you the IP address of your instance.

mykubeflow-nfs  us-east1-d  STANDARD  1024         kubeflow  READY  2019-05-15T01:23:53

Now create the PVC

cd /<path-to-kubeflow-deployment>/${KFAPP}/ks_app
ks generate google-cloud-filestore-pv google-cloud-filestore-pv --name="kubeflow-gcfs" \
   --storageCapacity="${GCFS_STORAGE}" \
  • GCFS_STORAGE The size of the Cloud Filestore persistent volume claim; e.g. “1G”
  • GCFS_INSTANCE_IP_ADDRESS The ip address of your Cloud Filestore instance; you can obtain this with gcloud:

     gcloud --project=${PROJECT} beta filestore instances list

Apply the changes:

cd /<path-to-kubeflow-deployment>/${KFAPP}
kfctl apply k8s

Using the PVC

With Jupyter

In the UI to create a jupyter notebook you can specify the PVC as an extra data volume.