GKE Filestore CSI Driver — Managed NFS and ReadWriteMany (RWX) Architecture 📁⚡
While block storage (Persistent Disk / Hyperdisk) provides high-performance I/O for single-instance workloads, standard disks only support ReadWriteOnce (RWO)—they cannot be mounted concurrently by multiple pods across different nodes. The Google Cloud Filestore CSI Driver for GKE bridges this gap by delivering fully managed, high-performance NFS (Network File System v3 and v4.1) volumes with native ReadWriteMany (RWX) semantics. It powers enterprise CMS platforms (WordPress, Drupal), shared CI/CD build caches, distributed machine learning scratch spaces, and legacy stateful applications requiring POSIX file sharing.
1. Architecture & The Filestore CSI Pipeline
The Filestore CSI driver decouples the Kubernetes PVC lifecycle from manual NFS server and export configuration.
KUBERNETES APPLICATION PODS (Across Multiple Nodes & Zones)
┌────────────────────────┐ ┌────────────────────────┐
│ Pod 1 (Node A / Zone 1)│ │ Pod 2 (Node B / Zone 2)│
│ Mount: `/shared/assets`│ │ Mount: `/shared/assets`│
└───────────┬────────────┘ └───────────┬────────────┘
│ │
└─────────────────┬────────────────┘
│ ReadWriteMany (RWX) NFS Mounts
▼
┌────────────────────────────────────────────────────────────────────────┐
│ PERSISTENT VOLUME CLAIM (PVC): 1 TiB │
│ StorageClass: `filestore-enterprise-multishare` │
└───────────────────────────────────┬────────────────────────────────────┘
│ Dynamic Provisioning
▼
┌────────────────────────────────────────────────────────────────────────┐
│ GKE FILESTORE CSI CONTROLLER │
│ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ MULTI-SHARE INSTANCE PACKER │ │
│ │ - Packs multiple small PVCs (e.g., 100 GiB) into a single │ │
│ │ high-throughput enterprise Filestore cluster (1 TiB minimum) │ │
│ │ - Eliminates paying for standalone NFS VMs per microservice │ │
│ └──────────────────────────────────┬───────────────────────────────┘ │
└─────────────────────────────────────┼──────────────────────────────────┘
│ Filestore API Calls
══════════════════════════════════════╪═══════════════════════════════════
GOOGLE CLUSTER NETWORK (VPC Subnet / RFC 1918 Private IP) │
▼
┌────────────────────────────────────────────────────────────────────────┐
│ GOOGLE MANAGED FILESTORE CLUSTER │
│ │
│ ┌────────────────────────┐ ┌────────────────────────┐ │
│ │ NFS v3 / v4.1 Engine │ │ Multi-Zone Replication │ │
│ │ 100,000+ IOPS │ │ 99.99% Availability SLA│ │
│ │ Multi-GB/s Throughput │ │ Non-disruptive snapshot│ │
│ └────────────────────────┘ └────────────────────────┘ │
└────────────────────────────────────────────────────────────────────────┘
Core Architecture Constructs
- ReadWriteMany (RWX) Semantics: Any number of pods spread across hundreds of GKE nodes can simultaneously mount the same directory, issue file locks, write files, and see real-time updates across nodes.
- Filestore Multi-Shares (Enterprise): Standard Filestore instances historically required a minimum 1 TiB allocation per instance ($660+/month). The GKE Filestore CSI Driver introduces Multi-Shares: a single 1 TiB Enterprise Filestore instance can be subdivided dynamically into dozens of smaller Kubernetes PVCs (e.g., 50 GiB each), dramatically lowering per-workload costs.
- Automated VolumeSnapshots: Supports the Kubernetes
VolumeSnapshotAPI, creating instantaneous, non-disruptive file system snapshots stored durably in Google Cloud Storage.
2. Filestore Tier Matrix & Sizing Boundaries
| Filestore Tier | Minimum Size | Max Throughput | Availability SLA | Supported Features |
|---|---|---|---|---|
| Basic HDD | 1 TiB | Up to 100 MB/s | 99.9% (Single Zone) | Backup targets, cold file shares |
| Basic SSD | 2.5 TiB | Up to 1,200 MB/s | 99.9% (Single Zone) | General web hosting, CMS, CI/CD |
| Zonal (High Scale) | 10 TiB | Up to 26,000 MB/s | 99.9% (Single Zone) | High-performance AI/ML, EDA, genomics |
| Enterprise | 1 TiB | Up to 1,200 MB/s | 99.99% (Multi-Zone) | Multi-share GKE packing, snapshots |
3. Production Deployment & CLI Operations (gcloud & kubectl)
1. Enable Filestore CSI Driver on GKE Cluster
gcloud container clusters update prod-regional-cluster \
--region=us-central1 \
--update-addons=GcpFilestoreCsiDriver=ENABLED \
--project=core-infrastructure-prod2. Deploy Multi-Share Enterprise StorageClass
Create filestore-multishare-sc.yaml:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: filestore-multishare
provisioner: filestore.csi.storage.gke.io
volumeBindingMode: Immediate
allowVolumeExpansion: true
parameters:
tier: enterprise
network: production-vpc
# Enables packing multiple PVCs into a single shared Filestore instance
multishare: "true"
instance-encryption-kms-key: projects/secops-kms-prod/locations/us-central1/keyRings/gke-storage-ring/cryptoKeys/filestore-keyApply StorageClass:
kubectl apply -f filestore-multishare-sc.yaml3. Deploy ReadWriteMany (RWX) PersistentVolumeClaim
Create shared-assets-pvc.yaml:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: shared-web-assets-pvc
namespace: web-apps
spec:
accessModes:
- ReadWriteMany # RWX access mode
storageClassName: filestore-multishare
resources:
requests:
storage: 100GiApply PVC:
kubectl apply -f shared-assets-pvc.yaml4. Deploy Multi-Replica Web Service Sharing the NFS Volume
Create cms-deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: enterprise-cms
namespace: web-apps
spec:
replicas: 10
selector:
matchLabels:
app: cms
template:
metadata:
labels:
app: cms
spec:
containers:
- name: nginx-php
image: wordpress:6-php8.2-apache
ports:
- containerPort: 80
volumeMounts:
- name: shared-uploads
mountPath: /var/www/html/wp-content/uploads
volumes:
- name: shared-uploads
persistentVolumeClaim:
claimName: shared-web-assets-pvcApply Deployment:
kubectl apply -f cms-deployment.yaml
# Verify all 10 pods across multiple nodes mounted the same volume
kubectl get pods -n web-apps -o wide5. Create Point-in-Time Filestore VolumeSnapshot
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
name: shared-assets-snapshot-nightly
namespace: web-apps
spec:
volumeSnapshotClassName: gke-filestore-snapshot-class
source:
persistentVolumeClaimName: shared-web-assets-pvcApply snapshot:
kubectl apply -f filestore-snapshot.yaml4. Quotas, Performance, and Configuration Limits
| Dimension / Parameter | Limit / Boundary | Engineering Guidance |
|---|---|---|
| Max Multi-Shares per Instance | Up to 80 shares per instance | Allows 80 microservices per 1 TiB Filestore cluster |
| Minimum Provisioned Share | 10 GiB per PVC | Fine-grained allocation |
| NFS Protocol Versions | NFS v3 and NFS v4.1 | NFS v3 recommended for raw speed |
| Max Concurrent TCP Sockets | Up to 10,000 clients | Connects thousands of pods simultaneously |
| Multi-Zone High Availability | 99.99% SLA (Enterprise) | Synchronous mirroring across 2 zones in region |
| Private IP Requirement | Requires reserved /26 range | Allocated from VPC Service Networking |
5. Official References & Documentation
- GKE Filestore CSI Driver Overview
- How to Access Filestore Instances using CSI
- Filestore Multi-Shares for GKE Optimization
- Filestore Enterprise Multi-Zone High Availability
- Google Cloud Filestore Pricing
6. Realistic Pricing Scenarios
Pricing components:
- Filestore Enterprise Tier: $0.66 per GiB-month (Includes synchronous multi-zone replication and 99.99% SLA).
- Filestore Basic HDD: $0.067 per GiB-month.
- Filestore Basic SSD: $0.17 per GiB-month.
- Filestore Snapshot Storage: $0.026 per GB-month (differential backup stored in GCS).
Scenario A: Enterprise Multi-Tenant CMS (Multi-Share Optimization)
- Architecture:
- 10 distinct web applications requiring RWX shared storage (e.g., 50 GiB each = 500 GiB total requested).
- Provisioned via a single 1 TiB Enterprise Multi-Share Filestore instance ($0.66/GiB).
- All 10 microservice PVCs carve out storage from this shared 1 TiB pool.
- Monthly Cost Calculation:
- 1 TiB Enterprise Instance (1,024 GiB): 1{,}024 \times \0.66/\text{GiB} = \mathbf{$675.84 / month}$.
- Cost per microservice (): **6,758.40/month—a 90% cost reduction)._
Scenario B: Shared CI/CD Build Cache (Basic SSD Tier)
- Architecture:
- 2.5 TiB Basic SSD Filestore instance mounted across 30 Jenkins / GitLab CI worker pods for caching Go, Node, and Maven dependencies.
- Generates 500 MB/s sustained sequential read/write throughput.
- Monthly Cost Calculation:
- Basic SSD (2.5 TiB = 2,560 GiB): 2{,}560 \times \0.17/\text{GiB} = \mathbf{$435.20 / month}$.
- Total Monthly Cost: $435.20 / month
7. Battle-Tested Nuggets & Production Gotchas
- NFS File Locking and Deadlocks in Multi-Pod Writes: When hundreds of containers mount the exact same NFS share and concurrently attempt to update the same SQLite database, search index, or log file, NFS file locking mechanisms (
NLMin NFS v3 or stateful leases in NFS v4) can enter deadlock states. NFS was designed for shared static assets, media uploads, and decoupled documents—never use Filestore as the backing storage for an embedded transactional relational database (like SQLite or embedded BerkeleyDB). - Service Networking Private IP Exhaustion: Filestore instances connect to your GKE cluster via VPC Service Peering (
servicenetworking.googleapis.com). Each Filestore cluster consumes an internal/26IP block (64 IP addresses). If your organization reserved a narrow/24range for Service Networking and attempts to provision 5 distinct Filestore instances, creation will fail withIP_SPACE_EXHAUSTED. Use Multi-Shares to consolidate shares into a single/26reservation. - Root Squashing UID/GID Permissions Trap: By default, NFS exports frequently enforce
root_squash, mapping container root (UID 0) tonobody:nogroup(UID 65534). If your container image executes asrootand attempts tochownor create folders, it will throwPermission denied. Configure theStorageClasswithnfs-export-optionsexplicitly definingsquash: no_root_squashor enforce non-root security contexts (runAsUser: 10001) across your pods. - The 1 TiB Minimum Billing Boundary: You can declare a Kubernetes PVC requesting
10Giof Filestore storage. However, if your StorageClass specifiestier: enterprisewithoutmultishare: "true", the Filestore API will provision a full 1 TiB physical instance behind the scenes, and you will be billed for 1,024 GiB ($675.84/month) for a 10 GiB PVC. Always setmultishare: "true"when allocating small RWX volumes. - NFS Client Caching Attribute Latency (
acregmin/acregmax): When Pod A writes a file to the Filestore share, Pod B on a different node might not see the new file for 3 to 30 seconds due to Linux NFS client attribute caching (actimeo). If your application architecture relies on Pod A writing a file and immediately signaling Pod B via Pub/Sub to read it, Pod B will throwFileNotFoundException. Fix this by tuning mount options in the StorageClass:mountOptions: ["acregmin=0", "acregmax=0"](at the cost of slightly higher metadata I/O). - Cross-Zone Network Egress with Basic Tier: Filestore Basic tiers are strictly zonal (deployed in a single availability zone, e.g.,
us-central1-a). If worker pods inus-central1-bandus-central1-cmount that Basic volume, every gigabyte of read/write traffic crosses zone boundaries, incurring GCP cross-zone egress charges ($0.01/GB) and adding 1-2ms network latency. For multi-zone regional GKE clusters, always use Filestore Enterprise, which replicates synchronously across multiple zones and optimizes local-zone reads.
Across the wiki
- EFS CSI Driver — shared file storage (Kubernetes)
- SMB) and Azure Blob CSI Architecture — shared file storage (Azure)
- Amazon EFS — shared file storage (AWS)
- Amazon FSx — shared file storage (AWS)