All Products
Search
Document Center

Container Service for Kubernetes:Configure the access mode of a dataset

Last Updated:Nov 01, 2024

In the Fluid framework, the default access mode of a dataset is ReadOnlyMany. You can modify the Dataset.spec.accessModes field of a dataset to change the access mode of the dataset. This topic describes how to configure the access mode of a dataset.

Use scenarios

Datasets support the ReadOnlyMany and ReadWriteMany access modes:

  • The ReadOnlyMany mode is ideal for scenarios where only read permissions on data are required. For example, you can use this mode if your application is designed to read data for training machine learning models or load machine learning model files in Object Storage Service (OSS) or File Storage NAS (NAS) for model inference services.

  • The ReadWriteMany mode is ideal for scenarios where both read and write permissions on data are required. For example, you can use this mode if your application is designed to read data for reprocessing and write the preprocessed data to the caching system or backend file system.

Sample dataset

apiVersion: data.fluid.io/v1alpha1
kind: Dataset
metadata:
  name: demo-readwrite
spec:
  mounts:
    - mountPoint: <mountpoint>
      name: demo
  accessModes:
    - ReadWriteMany

Parameter

Description

mountPoint

In this example, JindoRuntime (JindoFS) is used. Set the value to oss://<oss_bucket>/<bucket_dir>.

  • <oss_bucket>: the name of the OSS bucket.

  • <bucket_dir>: the subdirectory of the OSS bucket. The default value is the root directory.

accessModes

Set the access mode of the dataset. Valid values: ReadOnlyMany and ReadWriteMany.

  • ReadOnlyMany: Pods on the nodes to which the dataset is mounted can only read data from the dataset.

  • ReadWriteMany: Pods on the nodes to which the dataset is mounted can read data from and write data to the dataset.