Overview
Due to the inherent characteristics of containers, they are non-persistent. Once a container is deleted, the data within it is also lost. Leveraging Baidu AI Cloud's storage products, CCE offers solutions for container data sharing and persistence, suitable for scenarios such as big data analysis, media processing, and gaming.
PV (PersistentVolume) and PVC (PersistentVolumeClaim) are API resources provided by K8S to abstract storage details. By creating PV and PVC resources within the cluster, users can directly attach Baidu AI Cloud storage as persistent volumes to containers without needing to manage the underlying implementation, thus making it easier to provide persistent storage solutions for container clusters.
- PV: Persistent volume, a storage resource within the cluster. PV is independent of the lifecycle of Pods and can be created into different types of PVs based on different storage classes.
- PVC: Persistent volume claim, a storage request within the cluster, a claim for requesting storage resources.
- Volume: A data volume, which serves as a channel for data transmission between Pods and external storage devices. It is also a way for data sharing between containers within a Pod, between Pods, and between Pods and the external environment.
Description
The lifecycle of a volume aligns with that of the Pod. When a Pod is deleted, the associated volume is also removed. However, whether the data within the volume is lost depends on its specific type.
CCE supports various storage types, including K8S static persistent volumes and dynamic persistent volumes.
Storage class
Based on Baidu AI Cloud storage products including CDS, BOS, CFS, PFS and RapidFS, CCE provides comprehensive support for different storage classes:
| Storage class | Description |
|---|---|
| Local storage | Including HostPath, EmptyDir, ConfigMap and Secret |
| Cloud Disk Server (CDS) | Used through PV/PVC, supporting both static and dynamic methods |
| Cloud File System (PFS) | Used through PV/PVC, supporting both static and dynamic methods |
| Baidu AI Cloud Object Storage (BOS) | Used through PV/PVC, with only static persistent volumes available |
| Parallel Filesystem Service (PFS) | Used through PV/PVC, supporting both static and dynamic methods |
| RapidFS | Used through PV/PVC, supporting both static and dynamic methods |
Description
- Using Baidu AI Cloud's storage products is highly recommended; otherwise, if a node encounters an unrecoverable failure, locally stored data will also be irretrievable.
- Parallel Filesystem Service (PFS) supports different instance types, and CCE has different usage methods for different types of instances. For more information, please refer to Use Parallel Filesystem Service (PFS) and Use Parallel Filesystem Service (PFS) L2 respectively.
Storage class
For services with data persistence requirements, it is recommended to directly use Baidu AI Cloud storage (CDS, CFS, BOS, PFS and RapidFS). For local storage, if a node fails and cannot be recovered, data in the local disk may also be lost. The following is a brief introduction to the usage scenarios of different Baidu AI Cloud storage classes:
- Cloud Disk Server (CDS): There is a one-to-one relationship between a Pod and a CDS. Multiple Pods are not supported to mount the CDS, which provides block-level persistent storage and is usually used as the primary storage device for data that requires frequent and fine-grained updates (such as file systems and databases). It features high availability, high reliability and high performance;
- Cloud File System (CFS): There is a many-to-one relationship between Pods and CFS, supporting multiple reads and writes. CFS provides a standard NFS file system access protocol, offers file sharing capabilities for multiple Pods, and supports elastic scaling of capacity and performance, being a highly available and reliable distributed file system and suitable for scenarios such as big data analysis, media processing and content management;
- Baidu AI Cloud Object Storage (BOS): There is a many-to-one relationship between Pods and BOS, supporting one write and multiple reads. BOS is applicable to various scenarios such as data distribution, data backup, big data analysis, and audio/video file processing.
- Parallel Filesystem Service (PFS): There is a many-to-one relationship between Pods and PFS, supporting multiple reads and writes. PFS provides a fully managed, simple and scalable parallel filesystem service, and offers sub-millisecond access capabilities and high IOPS data read/write request capabilities for high-performance computing scenarios.
- RapidFS: There is a many-to-one relationship between Pods and RapidFS, supporting multiple reads and writes. RapidFS provides a highly reliable, highly available and elastic data lake accelerator, which accelerates the performance of service access storage such as big data, artificial intelligence and machine learning.
