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 service components to share data within the same deployment cluster by utilizing a shared file system. It provides the capability to easily share data across service components 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_data
is the name of the volume, though you can opt for a name of your choice.sharedFileSystem
is 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 service components. Here is an example:
volumes:
- source: file_system_data
target: /var/lib/postgresql/data
type: volume
x-omnistrate-storage:
aws:
clusterStorageType: AWS::EFS
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.
Alternatively, you can set up a shared file system by invoking Omnistrate APIs. Here are steps:
- Create a shared file system service component using the CreateResource API. Ensure that the
fileSystemConfiguration
is properly set up. - Create a storage volume for the shared file system using the CreateStorageVolumeConfig API. Make sure the
storageResourceID
points to the service component created above, and theinstanceStorageSizeGi
is set to your desired size.ClusterStorageType
should be set toAWS::EFS
. - Attach the storage volume to your service component 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.