Accessing GCS from GKE pods

444 Views Asked by At

I have a GKE cluster with different microservices that need to have access to blobs in a bucket. The same file may be accessed by different pods. File can are generally big (4Gb).

Which is the best practice for such a use case? I am confused if I should use

    bucket = storage.Bucket(client, bucket, user_project=project)
    blob_obj = bucket.blob(blob)
    blob_obj.download_to_filename(local_file)

or I should rather install GCS fuse or if there is a third method I am not aware of

2

There are 2 best solutions below

0
On BEST ANSWER

You may want to use a CSI driver if you decide to go with GCSFuse. Google doesn't have a supported CSI driver yet, but there is ofek/csi-gcs which you can find handy.

0
On

According to GCP doc, an officially supported GKE CSI driver for GCS fuse is under development.

It will be compatible with the most update version of k8s, and have less limitation comparing the OSS community version. e.g. It don't require PersistentVolume mapping to a GCS bucket like the ofek version do.