Updated on 2024-02-01 GMT+08:00

Overview

You can configure a storage class in the Add Container step of creating a workload.

Local Storage

Mount the file directory of the host where a container is located to a specified container path (corresponding to hostPath in Kubernetes). Alternatively, you can leave the source path empty (corresponding to emptyDir in Kubernetes). If the source path is left empty, a temporary directory of the host will be mounted to the mounting point of the container. A specified source path is used when data needs to be persistently stored on the host, while emptyDir is used when temporary storage is needed. A ConfigMap is a type of resource that stores configuration information required by a workload. Its content is user-defined. A secret is a type of resource that holds sensitive data, such as authentication and key information, required by a workload. Its content is user-defined. For details, see Mounting a Local Volume.

PersistentVolumeClaims (PVCs)

You can create persistent volumes and mount them to a container path. When containers are migrated, the cloud storage is mounted to the new container to ensure data reliability. For details, see Mounting a PV. Therefore, you are advised to select PVCs when creating a workload and store pod data on the corresponding cloud storage. If you store pod data on a local volume and a fault occurs on the node, the data cannot be restored.

  • Huawei Cloud cluster: UCS allows you to use Elastic Volume Service (EVS), Object Storage Service (OBS), and Scalable File Service (SFS) and mounts them to the container path of the Huawei Cloud cluster.
    • EVS: offers scalable block storage with high reliability, high performance, and extensive specifications for containers. EVS stores binary data and cannot store files directly. This storage class is applicable when data needs to be stored permanently.
    • SFS: provides high-performance file storage (NAS) that can be expanded on demand. It provides shared file access for containers and is used for persistent storage in ReadWriteMany scenarios, including media processing, content management and web services, big data and application analysis.
    • OBS: provides unlimited storage capacity, stores files in any format, and caters to the needs of common users. It is mainly designed for scenarios involving storage and analysis of massive amounts of data, query of historical data details, analysis on a large number of behavior logs, and statistical analysis on public transactions.
  • When a non-Huawei Cloud cluster uses a PVC to mount cloud storage, the cluster provider must support StorageClasses. For details, see Storage Classes.