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¶
You can define shared file system using your compose specification. Here is the example:
volumes:
file_system_data:
driver: sharedFileSystem
driver_opts:
efsThroughputMode: provisioned
efsPerformanceMode: generalPurpose
efsProvisionedThroughputInMibps: 100
file_system_datais the name of the volume, though you can opt for a name of your choice.sharedFileSystemis the driver type required to enable Omnistrate shared file system.- Various options under the driver_opts section are available to customize the shared file system.
Once you complete the shared file system configuration, you can mount the volume to your Resources. Here is an example:
volumes:
- source: file_system_data
target: /var/lib/postgresql/data
type: volume
x-omnistrate-storage:
aws:
clusterStorageType: AWS::EFS
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 is volume.
Alternatively, you can set up a shared file system by invoking Omnistrate APIs. Here are steps:
- Create a shared file system Resource using the CreateResource API. Ensure that the
fileSystemConfigurationis properly set up. - Create a storage volume for the shared file system using the CreateStorageVolumeConfig API. Make sure the
storageResourceIDpoints to the Resource created above, and theinstanceStorageSizeGiis set to your desired size.ClusterStorageTypeshould be set toAWS::EFS. - Attach the storage volume to your Resource using the AddStorageVolumeConfig API.
Note
The shared file system is only available for AWS EFS storage. If you need to enable other shared file systems, please contact us at support@omnistrate.com.