Skip to content

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:

  • source is the name of the volume you defined in the previous step.
  • target is the path where you want to mount the volume.
  • type specifies the type of the volume; in this case, it is volume.
  • x-omnistrate-storage defines the type of storage for each cloud provider.

volume properties:

  • file_system_data is the name of the volume, you can opt for a name of your choice.
  • driver: sharedFileSystem is the driver type required to enable shared file system functionality.
  • driver_opts defines various options to customize the shared file system configuration for different cloud providers:
  • efsThroughputMode: Specifies the throughput mode for AWS EFS. Can be set to bursting or provisioned. Use provisioned when you need consistent throughput performance. See AWS EFS Throughput Modes for details.
  • efsPerformanceMode: Defines the performance mode for AWS EFS. Options are generalPurpose (for latency-sensitive workloads) or maxIO (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 using provisioned throughput 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_HDD and BASIC_SSD require at least 1TiB, ZONAL requires at least 2.5TiB, and ENTERPRISE requires at least 1TiB. For the most up-to-date details, see the GCP Filestore documentation.
  • filestoreTier: Defines the service tier for GCP Filestore. Options include BASIC_HDD, BASIC_SSD, ZONAL, or ENTERPRISE depending 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"