Shared File System¶
Why using a shared file system¶
In modern SaaS application deployments on Kubernetes, you often need to save data in a persistent volume and share it across different pods. For example, when setting up an AI model training system, multiple workers might need access to the same dataset stored in a persistent volume. This is where a shared file system is a good fit. Additionally, if your data volume is growing and you need to scale the volume size dynamically without downtime, a shared file system is an excellent solution for you.
Omnistrate allows your Resources to share data within the same deployment cluster by utilizing a shared file system. It provides the capability to easily share data across Resources and to scale your underlying storage without any downtime.
Configuring shared file system¶
To configure a shared file system using compose specification you can define the shared volume at the root level and then define the volume and mount for each resource.
Here is the example on how to define and mount a shared volume:
services:
serviceA:
volumes:
- source: file_system_data
target: /var/data
type: volume
x-omnistrate-storage:
aws:
clusterStorageType: AWS::EFS
gcp:
clusterStorageType: GCP::FILESTORE
azure:
clusterStorageType: AZURE::FILE_STORAGE
volumes:
file_system_data:
driver: sharedFileSystem
driver_opts:
# efs configuration
efsThroughputMode: provisioned
efsPerformanceMode: generalPurpose
efsProvisionedThroughputInMibps: 100
# filestore configuration
filestoreCapacity: "1TiB"
filestoreTier: "BASIC_SSD"
service volume properties:
sourceis the name of the volume you defined in the previous step.targetis the path where you want to mount the volume.typespecifies the type of the volume; in this case, it isvolume.x-omnistrate-storagedefines the type of storage for each cloud provider.
volume properties:
file_system_datais the name of the volume, you can opt for a name of your choice.driver: sharedFileSystemis the driver type required to enable shared file system functionality.driver_optsdefines various options to customize the shared file system configuration for different cloud providers:efsThroughputMode: Specifies the throughput mode for AWS EFS. Can be set toburstingorprovisioned. Useprovisionedwhen you need consistent throughput performance. See AWS EFS Throughput Modes for details.efsPerformanceMode: Defines the performance mode for AWS EFS. Options aregeneralPurpose(for latency-sensitive workloads) ormaxIO(for higher aggregate throughput and operations per second). See AWS EFS Performance Modes for more information.efsProvisionedThroughputInMibps: Sets the provisioned throughput in MiB/s for AWS EFS when usingprovisionedthroughput mode. This value determines the baseline throughput performance. See AWS EFS Provisioned Throughput for details.filestoreCapacity: Specifies the storage capacity for GCP Filestore. Must include a unit (e.g., "1TiB"). Minimum capacity requirements vary by tier:BASIC_HDDandBASIC_SSDrequire at least 1TiB,ZONALrequires at least 2.5TiB, andENTERPRISErequires at least 1TiB. For the most up-to-date details, see the GCP Filestore documentation.filestoreTier: Defines the service tier for GCP Filestore. Options includeBASIC_HDD,BASIC_SSD,ZONAL, orENTERPRISEdepending on your performance and capacity requirements.
This configuration will provision a new Shared File System for each instance deployed.
Mounting a shared file volume in multiple resources¶
The same volume can be mounted in different pods:
services:
serviceA:
volumes:
- source: file_system_data
target: /var/data
type: volume
x-omnistrate-storage:
aws:
clusterStorageType: AWS::EFS
gcp:
clusterStorageType: GCP::FILESTORE
azure:
clusterStorageType: AZURE::FILE_STORAGE
serviceB:
volumes:
- source: file_system_data
target: /var/data
type: volume
x-omnistrate-storage:
aws:
clusterStorageType: AWS::EFS
gcp:
clusterStorageType: GCP::FILESTORE
azure:
clusterStorageType: AZURE::FILE_STORAGE
volumes:
file_system_data:
driver: sharedFileSystem
driver_opts:
# efs configuration
efsThroughputMode: provisioned
efsPerformanceMode: generalPurpose
efsProvisionedThroughputInMibps: 100
# filestore configuration
filestoreCapacity: "1TiB"
filestoreTier: "BASIC_SSD"