gcsfuse to mount a bucket in GKE and/or python3 boto to stream write?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
There are really two separate questions here: how to expose a Google Cloud Storage bucket to a workload running on GKE, and how to stream data into that bucket from Python. For GKE mounts, the current Google Cloud recommendation is Cloud Storage FUSE through the GKE CSI driver. For Python writes, the normal client is google-cloud-storage, not boto3.
Mounting a Bucket in GKE
If an application wants file-like access to bucket objects, Cloud Storage FUSE is the relevant technology. In current GKE setups, this is typically done through the Cloud Storage FUSE CSI driver rather than by manually installing gcsfuse inside each container.
A persistent-volume style manifest looks like this:
Then mount the claim into a Pod like any other volume. This gives the container normal file I/O semantics for many workloads, though it is still object storage underneath.
When a Mount Is a Good Fit
Mounting the bucket is useful when the application expects path-based file access, for example:
- reading model checkpoints
- iterating over many objects as files
- integrating with software that is not written for object-store APIs
It is less ideal when the application mostly performs direct uploads and downloads of known objects. In those cases, the client library is usually simpler and more explicit.
For Python Writes, Use the GCS Client Library
The title mentions boto, but boto3 is the AWS S3 library, not the normal Google Cloud Storage client. For GCS uploads from Python, use google-cloud-storage.
A basic upload from a file-like stream looks like this:
This avoids the mount entirely and talks to Cloud Storage through the supported API.
Streaming Larger Content
If you are writing generated data gradually, a temporary local stream can still work well:
For many applications, this is simpler and more reliable than mounting object storage as a filesystem.
Which Approach Should You Choose
A practical rule is:
- choose the GKE mount path when the application truly needs filesystem semantics
- choose the Python client library when the application naturally thinks in terms of object uploads and downloads
The second approach is often better for streaming writes, because it avoids the semantic mismatch between filesystems and object storage.
Authentication Still Matters
Whether you mount the bucket or use the Python client, the workload needs correct Google Cloud authentication and IAM permissions. In GKE, that typically means Workload Identity or another supported service-account mapping. A correct library call with the wrong permissions still fails.
Common Pitfalls
The biggest pitfall is reaching for boto3 when the target is Google Cloud Storage. It is the wrong default library for GCS.
Another common issue is expecting a bucket mount to behave exactly like a local POSIX filesystem. Cloud Storage FUSE is useful, but it still sits on top of object storage with different consistency and performance tradeoffs.
People also underestimate the IAM setup. Both the CSI-mounted bucket and the Python client depend on the workload having the right Cloud Storage permissions.
Summary
- On GKE, bucket mounts are typically handled through the Cloud Storage FUSE CSI driver.
- Use a mount when the application needs filesystem-style access to bucket objects.
- For Python stream uploads, prefer the official
google-cloud-storageclient library. - '
boto3is primarily for AWS S3 and is not the normal GCS client choice.' - Pick the approach that matches the workload's access pattern instead of forcing everything through a mount.

