Updated on 2023-06-25 GMT+08:00

Configuring Data Storage

Container storage is a component that provides storage for applications. Multiple types of storage are supported. An application component can use any amount of storage.

If Cloud Container Engine is selected for Deployment System on the Configure Basic Settings page during component deployment, you can set data storage.

Scenario

Table 1 Storage scenarios

Storage Type

Scenario

EVS Disks

EVS supports three specifications: common I/O, high I/O, and ultra-high I/O.

  • Common I/O: The backend storage is provided by the Serial Advanced Technology Attachment (SATA) storage media. Common I/O is applicable to scenarios where large capacity is needed but high read/write rate is not required, and the volume of transactions is low. Examples include development testing and enterprise office applications.
  • High I/O: The backend storage is provided by the Serial Attached SCSI (SAS) storage media. High I/O is applicable to scenarios where relatively high performance, high read/write rate, and real-time data storage are required. Examples include creating file systems and sharing distributed files.
  • Ultra-high I/O: The backend storage is provided by the Solid-State Drive (SSD) storage media. Ultra-high I/O is applicable to scenarios where high performance, high read/write rate, and data-intensive applications are required. Examples include NoSQL and data warehouse.

HostPath

The file directory of the host where the application component is located is mounted to the specified mounting point of the application. If the application component needs to access /etc/hosts, use HostPath to map /etc/hosts.

NOTICE:

Do not mount the file directory to a system directory such as / or /var/run. Otherwise, an exception occurs. An empty directory is recommended. If the directory is not empty, ensure that the directory does not contain any file that affects component instance startup. Otherwise, the files will be replaced, causing startup exceptions.

EmptyDir

Used for temporary storage. The lifecycle of temporary storage is the same as that of an application component instance. When an application instance disappears, EmptyDir will be deleted and the data is permanently lost.

ConfigMap

Keys in a configuration item are mapped to an application so that configuration files can be mounted to the specified application component directory.

Secret

Sensitive information such as application authentication and application keys is stored in a secret, and the secret is mounted to a specified path of the application component.

EVS Disks

  1. When deploying an application component, choose Advanced Settings > Component Configuration on the Configure Component page.
  2. Choose Data Storage > Cloud Storage > Add Cloud Storage and set parameters by referring to Table 2.

    Table 2 EVS disks

    Parameter

    Description

    Storage Type

    Select EVS disk.

    The method of using an EVS disk is the same as that of using a traditional disk. However, EVS disks have higher data reliability and I/O throughput and are easier to use. They apply to file systems, databases, or other system software or workloads that require block storage devices.

    Storage Allocation Mode

    • Manual

      Select a created storage.

    • Automatic

      A storage is created automatically. You need to enter the storage capacity.

      1. If Storage Class is set to EVS Disk, select an AZ for creating the EVS disk first.
      2. Select a storage sub-type.

        High I/O: EVS disks that have high I/O and use SAS.

        Common I/O: EVS disks that use SATA.

        Ultra-high I/O: EVS disks that have ultra-high I/O and use SSD.

      3. Enter the storage capacity, in the unit of GB. Ensure that the storage capacity quota is not exceeded; otherwise, creation will fail.

    Add Docker Mounting

    1. Set Mounting Path: Enter the application path to which the data volume is mounted.
      NOTICE:
      • Do not mount a data volume to a system directory such as / or /var/run. Otherwise, an exception occurs. An empty directory is recommended. If the directory is not empty, ensure that the directory does not contain any file that affects application startup. Otherwise, the files will be replaced, causing application startup exceptions. As a result, the application fails to be created.
      • When the data volume is mounted to a high-risk directory, you are advised to use a low-permission account to start the application; otherwise, high-risk files on the host may be damaged.
    2. Set Permission.
      • Read-only: allows you only to read data volumes in the application path.
      • Read/Write: allows you to modify data volumes in the application path. To prevent data loss, newly written data will not be migrated during application migration.

  3. Click OK.

HostPath

The file or directory of the host is mounted to the application component.

  1. When deploying an application component, choose Advanced Settings > Component Configuration on the Configure Component page.
  2. Choose Data Storage > Local Disk > Add Local Disk and set parameters by referring to Table 3.

    Table 3 HostPath

    Parameter

    Description

    Local Disk Type

    Select HostPath.

    Host Path

    Enter the host path, for example, /etc/hosts.

    Docker Mounting

    1. Set Mounting Path: Enter the application path to which the data volume is mounted.
      NOTICE:
      • Do not mount a data volume to a system directory such as / or /var/run. Otherwise, an exception occurs. An empty directory is recommended. If the directory is not empty, ensure that the directory does not contain any file that affects application startup. Otherwise, the files will be replaced, causing application startup exceptions. As a result, the application fails to be created.
      • When the data volume is mounted to a high-risk directory, you are advised to use a low-permission account to start the application; otherwise, high-risk files on the host may be damaged.
    2. Set Permission.
      • Read-only: allows you only to read data volumes in the application path.
      • Read/Write: allows you to modify data volumes in the application path. To prevent data loss, newly written data will not be migrated during application migration.

  3. Click OK.

EmptyDir

EmptyDir applies to temporary data storage, disaster recovery, and shared running. It will be deleted upon deletion or transfer of application component instances.

  1. When deploying an application component, choose Advanced Settings > Component Configuration on the Configure Component page.
  2. Choose Data Storage > Local Disk > Add Local Disk and set parameters by referring to Table 4.

    Table 4 EmptyDir

    Parameter

    Description

    Local Disk Type

    Select EmptyDir.

    Disk Media

    • If you select Memory, the running speed is improved, but the storage capacity is limited by the memory size. This mode applies to a small amount of data with high requirements on reading and writing efficiency.
    • If Memory is not selected, data is stored in disks, which is applicable to a large amount of data with low requirements on reading and writing efficiency.

    Docker Mounting

    1. Set Mounting Path: Enter the application path to which the data volume is mounted.
      NOTICE:
      • Do not mount a data volume to a system directory such as / or /var/run. Otherwise, an exception occurs. An empty directory is recommended. If the directory is not empty, ensure that the directory does not contain any file that affects application startup. Otherwise, the files will be replaced, causing application startup exceptions. As a result, the application fails to be created.
      • When the data volume is mounted to a high-risk directory, you are advised to use a low-permission account to start the application; otherwise, high-risk files on the host may be damaged.
    2. Set Permission.
      • Read-only: allows you only to read data volumes in the application path.
      • Read/Write: allows you to modify data volumes in the application path. To prevent data loss, newly written data will not be migrated during application migration.

  3. Click OK.

ConfigMap

ServiceStage separates the application codes from configuration files. ConfigMap is used to process application component configuration parameters.

  1. When deploying an application component, choose Advanced Settings > Component Configuration on the Configure Component page.
  2. Choose Data Storage > Local Disk > Add Local Disk and set parameters by referring to Table 5.

    Table 5 ConfigMap

    Parameter

    Description

    Local Disk Type

    Select ConfigMap.

    Configuration Item

    Select the desired configuration item name.

    Create a configuration item. For details, see Creating a Configuration Item.

    Docker Mounting

    1. Set Mounting Path: Enter the application path to which the data volume is mounted.
      NOTICE:
      • Do not mount a data volume to a system directory such as / or /var/run. Otherwise, an exception occurs. An empty directory is recommended. If the directory is not empty, ensure that the directory does not contain any file that affects application startup. Otherwise, the files will be replaced, causing application startup exceptions. As a result, the application fails to be created.
      • When the data volume is mounted to a high-risk directory, you are advised to use a low-permission account to start the application; otherwise, high-risk files on the host may be damaged.
    2. Set Permission.
      • Read-only: allows you only to read data volumes in the application path.
      • Read/Write: allows you to modify data volumes in the application path. To prevent data loss, newly written data will not be migrated during application migration.

  3. Click OK.

Secret

The data in the secret is mounted to the specified application component. The content of the secret is user-defined.

  1. When deploying an application component, choose Advanced Settings > Component Configuration on the Configure Component page.
  2. Choose Data Storage > Local Disk > Add Local Disk and set parameters by referring to Table 6.

    Table 6 Secret

    Parameter

    Description

    Local Disk Type

    Select Secret.

    Secret Item

    Select the desired secret name.

    For details about how to create a secret, see Creating a Secret.

    Docker Mounting

    1. Set Mounting Path: Enter the application path to which the data volume is mounted.
      NOTICE:
      • Do not mount a data volume to a system directory such as / or /var/run. Otherwise, an exception occurs. An empty directory is recommended. If the directory is not empty, ensure that the directory does not contain any file that affects application startup. Otherwise, the files will be replaced, causing application startup exceptions. As a result, the application fails to be created.
      • When the data volume is mounted to a high-risk directory, you are advised to use a low-permission account to start the application; otherwise, high-risk files on the host may be damaged.
    2. Set Permission.
      • Read-only: allows you only to read data volumes in the application path.
      • Read/Write: allows you to modify data volumes in the application path. To prevent data loss, newly written data will not be migrated during application migration.

  3. Click OK.