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
Storage Type |
Scenario |
---|---|
EVS supports three specifications: common I/O, high I/O, and ultra-high I/O.
|
|
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. |
|
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. |
|
Keys in a configuration item are mapped to an application so that configuration files can be mounted to the specified application component directory. |
|
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
- When deploying an application component, choose Advanced Settings > Component Configuration on the Configure Component page.
- Choose Data Storage > Cloud Storage > Add Cloud Storage and set parameters by referring to Table 2.
- Click OK.
HostPath
The file or directory of the host is mounted to the application component.
- When deploying an application component, choose Advanced Settings > Component Configuration on the Configure Component page.
- 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
- 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.
- 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.
- Set Mounting Path: Enter the application path to which the data volume is mounted.
- 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.
- When deploying an application component, choose Advanced Settings > Component Configuration on the Configure Component page.
- 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
- 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.
- 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.
- Click OK.
ConfigMap
ServiceStage separates the application codes from configuration files. ConfigMap is used to process application component configuration parameters.
- When deploying an application component, choose Advanced Settings > Component Configuration on the Configure Component page.
- 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
- 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.
- 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.
- Set Mounting Path: Enter the application path to which the data volume is mounted.
- Click OK.
Secret
The data in the secret is mounted to the specified application component. The content of the secret is user-defined.
- When deploying an application component, choose Advanced Settings > Component Configuration on the Configure Component page.
- 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
- 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.
- 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.
- Set Mounting Path: Enter the application path to which the data volume is mounted.
- Click OK.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot