Updated on 2024-11-11 GMT+08:00

Using EVS Volumes

Prerequisites

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

Notes and Constraints

  • EVS disks cannot be attached across AZs and cannot be used by multiple workloads, multiple pods of the same workload, or multiple jobs.
  • Data in a shared disk cannot be shared between nodes in a CCE cluster. If the same EVS disk is attached to multiple nodes, read and write conflicts and data cache conflicts may occur. When creating a Deployment, you are advised to create only one pod if you want to use EVS disks.
  • For clusters earlier than v1.19.10, if an HPA policy is used to scale out a workload with EVS volumes mounted, the existing pods cannot be read or written when a new pod is scheduled to another node.

    For clusters of v1.19.10 and later, if an HPA policy is used to scale out a workload with EVS volume mounted, a new pod cannot be started because EVS disks cannot be attached.

  • When you create a StatefulSet and add a cloud storage volume, existing EVS volumes cannot be used.
  • EVS disks that have partitions or have non-ext4 file systems cannot be imported.
  • Container storage in CCE clusters of Kubernetes 1.13 or later version supports encryption. Currently, E2E encryption is supported only in certain regions.
  • EVS volumes cannot be created in specified enterprise projects. Only the default enterprise project is supported.

Creating an EVS Disk

  1. Log in to the CCE console. In the navigation pane, choose Resource Management > Storage. Click Buy EVS Disk.
  2. Configure basic disk information. Table 1 describes the parameters.

    Table 1 Configuring basic disk information

    Parameter

    Description

    * PVC Name

    New PVC Name: name of the PVC to be created. A storage volume is automatically created when a PVC is created. One PVC corresponds to one storage volume. The storage volume name is automatically generated when the PVC is created.

    Cluster Name

    Cluster where the EVS disk is deployed.

    Namespace

    Select the namespace where the EVS disk is deployed. If you do not need to select a namespace, retain the default value.

    Volume Capacity (GB)

    Size of the storage to be created.

    Access Mode

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

    • ReadWriteOnce (RWO): The volume can be mounted as read-write by a single node, and data reading and writing are supported based on a non-shared EVS volume. EVS volumes in RWO mode are supported since v1.13.10-r1.

    Primary AZ

    AZ to which the volume belongs.

    Type

    Type of the new EVS disk.

    • High I/O: uses serial attached SCSI (SAS) drives to store data.
    • Ultra-high I/O: uses solid state disk (SSD) drives to store data.

    Storage Format

    The default value is CSI and cannot be changed.

  3. Click Buy Now. Review your order, click Submit, and wait until the creation is successful.

    The file system is displayed in the list. When its status becomes Normal, the file system is created successfully.

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

Adding an EVS Volume

  1. Create a workload or job by referring to Creating a Deployment, Creating a StatefulSet, 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 volume type to EVS.

    Table 2 Parameters required for mounting an EVS volume

    Parameter

    Description

    Type

    EVS: You can use EVS disks the same way you use traditional hard disks on servers. EVS disks deliver higher data reliability and I/O throughput and are easy to use. They can be used for file systems, databases, or other system software and applications that require block storage resources.

    CAUTION:
    • To attach an EVS disk to a workload, you must set the number of pods to 1 when creating the workload. If multiple pods are configured, you cannot attach EVS disks.
    • When you create a StatefulSet and add a cloud storage volume, existing EVS volumes cannot be used.
    • EVS disks cannot be attached across AZs and cannot be used by multiple workloads, multiple pods of the same workload, or multiple jobs.

    Allocation Mode

    Manual

    Select a created disk. If no disk is available, follow the prompts to create one.

    For the same cluster and namespace, you can use an existing storage volume when creating a Deployment (with Allocation Mode set to Manual).

    When creating a StatefulSet, you can only use a volume automatically allocated by the system (only Automatic is available for Allocation Mode).

    Automatic

    If you select Automatic, you need to configure the following items:

    1. Access Mode: permissions of user applications on storage resources (PVs).
      • ReadWriteOnce (RWO): The volume can be mounted as read-write by a single node, and data reading and writing are supported based on a non-shared EVS volume. EVS volumes in RWO mode are supported since v1.13.10-r1.
    2. Availability Zone: AZ where the storage volume is located. Only the AZ where the node is located can be selected.
    3. Sub-Type: Select a storage subtype.
      • High I/O: uses serial attached SCSI (SAS) drives to store data.
      • Ultra-high I/O: uses solid state disk (SSD) drives to store data.
    4. Storage Capacity: Enter the storage capacity in the unit of GB. Ensure that the storage capacity quota is not exceeded; otherwise, creation will fail.
    5. 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

    1. Click Add Container Path.
    2. Container Path: Enter the container path to which the data volume is mounted.
      NOTICE:
      • Do not mount a data volume to a system directory such as / or /var/run; this action may cause a container error to occur. 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.
      • 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.
    Figure 1 Adding a cloud volume

  3. Click OK.

Importing an EVS Disk

CCE allows you to import existing EVS disks.

An EVS disk can be imported into only one namespace. If an EVS disk has been imported into a namespace, it is invisible in other namespaces and cannot be imported again. If you want to import an EVS disk that has file system (ext4) formatted, ensure that no partition has been created for the disk. Otherwise, data may be lost.

  1. Log in to the CCE console. In the navigation pane, choose Resource Management > Storage. On the EVS tab page, click Import.
  2. Select one or more EVS disks that you want to import. Then, click OK.

Yearly/Monthly-Billed EVS Disks

  1. Create a yearly/monthly-billed EVS disk with the required capacity on the cloud server console.
  2. Back on the EVS tab page of the CCE console, click Import. Select the EVS disk you just created, and click OK.

Unbinding an EVS Disk

After an EVS volume is successfully created or imported, the EVS volume is automatically bound to the current cluster and cannot be used by other clusters. When the volume is unbound from the cluster, other clusters can still use the volume.

If the EVS volume has been mounted to a workload, it cannot be unbound from the cluster.

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

Related Operations

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

Operation

Description

Deleting an EVS volume

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