NFS Ganesha for Cost-Effective RWM Storage
· Part of my work at Carousell
Abstract: Implemented NFS Ganesha on Kubernetes to provide a cost-effective ReadWriteMany (RWM) storage solution, overcoming the limitations of standard GCP storage offerings.
Tech: #Kubernetes#NFS#GCP#Persistent Storage#Cost Optimization
The Challenge
A key challenge when running certain stateful applications on Google Kubernetes Engine (GKE) is the need for persistent storage with a ReadWriteMany
(RWM) access mode, which allows a volume to be mounted as read-write by multiple pods simultaneously. The native GCP solutions for this, like Filestore, were prohibitively expensive for our use case and budget. This limitation blocked the deployment of several important workloads to our Kubernetes clusters.
The Solution
To solve this problem, I researched and implemented a solution using NFS Ganesha, an open-source NFS server that runs in user space. The project involved:
- Architecture: Designing a resilient architecture where an NFS Ganesha server could be deployed within our Kubernetes cluster, backed by a standard, cost-effective Google Persistent Disk (in
ReadWriteOnce
mode). - Implementation: Deploying and configuring the NFS Ganesha server, which then exports the underlying block storage as an NFS share.
- Integration: Configuring a
PersistentVolume
(PV) that points to this internal NFS server, which can then be claimed by multiple pods via aPersistentVolumeClaim
(PVC) withReadWriteMany
access.
This innovative approach provided a fully functional and budget-friendly RWM storage layer, unblocking critical application deployments and improving resource utilization without incurring high cloud storage costs.