Updated on 2022-09-30 GMT+08:00

Using SFS Volumes

Prerequisites

You have created a CCE cluster and installed the CSI plug-in (everest) in the cluster.

Notes and Constraints

  • Container storage in CCE clusters of Kubernetes 1.13 or later version supports encryption. Currently, E2E encryption is supported only in certain regions.
  • Volumes cannot be created in specified enterprise projects. Only the default enterprise project is supported.

Creating an SFS Volume

  1. Log in to the CCE console. In the navigation pane, choose Resource Management > Storage.
  2. On the SFS tab, click Create SFS File System.
  3. Configure basic information, as shown in Table 1.

    Table 1 Parameters for creating an SFS volume

    Parameter

    Parameter Description

    * PVC Name

    Name of the new PVC, which is different from the volume name. The actual volume name is automatically generated when the PV is created by the PVC.

    Cluster Name

    Cluster to which the file system volume belongs.

    Namespace

    Namespace in which the volume is created.

    Total Capacity

    The total capacity is the capacity of a single volume. Fees are charged by actual usage.

    Access Mode

    Access permissions of user applications on storage resources (PVs).

    • ReadWriteMany (RWX): The SFS volume can be mounted as read-write by multiple nodes.

    Storage Format

    The default value is CSI and cannot be changed.

  4. Click Create.

    The volume is displayed in the list. When PVS Status becomes Bound, the volume is created successfully.

  5. Click the volume name to view detailed information about the volume.

Adding an SFS Volume

  1. Create a workload or job by referring to Creating a Deployment, Creating a StatefulSet, Creating a DaemonSet, or Creating a Job. During creation, expand Data Storage after adding a container. On the Cloud Volume tab page, click Add Cloud Volume.
  2. Set the storage class to SFS.

    Table 2 Parameters for mounting an SFS volume

    Parameter

    Parameter Description

    Type

    File Storage (NFS): This type applies to a wide range of scenarios, including media processing, content management, big data, and application analysis.

    Allocation Mode

    Manual

    • Name: Select a created file system. You need to create a file system in advance. For details about how to create a file system, see Creating an SFS Volume.
    • Sub-Type: subtype of the created file storage.
    • Storage Capacity: This field is one of the PVC attributes. If the storage capacity has been expanded on the IaaS side, it is normal that the capacity values are inconsistent. The PVC capacity is the same as the storage entity capacity only after end-to-end container storage capacity expansion is supported for CCE clusters of v1.13.

    Automatic

    An SFS volume is created automatically. You need to enter the storage capacity.

    • Sub-Type: Select NFS.
    • Storage Capacity: Specify the total storage capacity, in GB. Ensure that the storage capacity quota is not exceeded; otherwise, creation will fail.
    • Storage Format: The default value is CSI.

      The container storage interface (CSI) is used to establish a set of standard storage management interfaces between Kubernetes and external storage systems to provide storage services for containers.

    Add Container Path

    Configure the following parameters:

    1. subPath: Enter the subpath of the file storage, for example, /tmp.

      If this parameter is not specified, the root path of the data volume is used by default. Currently, only file storage is supported. The value must be a relative path and cannot start with a slash (/) or ../.

    2. Container Path: Enter the path of the container, for example, /tmp.
      The container path must not be a system directory, such as / and /var/run. Otherwise, an exception occurs. You are advised to mount the volume to an empty directory. If the directory is not empty, ensure that there are no files affecting container startup in the directory. Otherwise, such files will be replaced, resulting in failures to start the container and create the workload.
      NOTICE:

      If the volume is mounted to a high-risk directory, you are advised to use an account with minimum permissions to start the container; otherwise, high-risk files on the host machine may be damaged.

    3. Set permissions.
      • Read-only: You can only read the data volumes mounted to the path.
      • Read/Write: You can modify the data volumes mounted to the path. Newly written data is not migrated if the container is migrated, which may cause a data loss.

    Click Add Container Path to add multiple settings. Then, click OK.

  3. Click OK.

Importing an SFS Volume

CCE allows you to import existing SFS volumes.

  1. Log in to the CCE console. In the navigation pane, choose Resource Management > Storage. On the SFS tab page, click Import.
  2. Select one or more SFS volumes that you want to attach.
  3. Select the target cluster and namespace. Then, click OK.

Unbinding an SFS Volume

When an SFS volume is successfully created or imported, the volume is automatically bound to the current cluster. Other clusters can also use the volume. When the SFS volume is unbound from the cluster, other clusters can still import and use the volume.

If the SFS volume has been attached to a workload, the volume cannot be unbound from the cluster.

  1. Log in to the CCE console. In the navigation pane, choose Resource Management > Storage. In the SFS volume list, click Unbind next to the target volume.
  2. Confirm the unbinding, and click OK.

Related Operations

After an SFS volume is created, you can perform the operation described in Table 3.
Table 3 Other operations

Operation

Description

Deleting an SFS volume

  1. Select the SFS volume to be deleted and click Delete in the Operation column.
  2. Follow the prompts to delete the EVS disk.

Importing an SFS volume

CCE allows you to import existing SFS volumes.

  1. On the SFS tab page, click Import.
  2. Select one or more SFS volumes that you want to attach.
  3. Select the target cluster and namespace.
  4. Click Yes.