All Products
Search
Document Center

Container Compute Service:Use Alibaba Cloud storage services in ACS clusters

Last Updated:Dec 17, 2024

The storage capability of Alibaba Cloud Container Compute Service (ACS) clusters is developed based on the Kubernetes Container Storage Interface (CSI) plug-in. This capability is integrated with disks, File Storage NAS (NAS) and Object Storage Service (OSS), and is compatible with Kubernetes-native EmptyDir volumes and ConfigMaps. This topic describes the Alibaba Cloud storage services supported by ACS, including their features, application scenarios, and mounting methods.

Storage basics

Volume

Files in containers are temporarily stored on disks. Temporary storage causes the following issues to occur in applications that run in containers:

  • When multiple containers run in the same pod, files cannot be shared among the containers.

  • If a container fails, the files that generated during the running of the container are lost when the container is rebuilt.

To address the preceding issues, Kubernetes creates the concept of volume to provide capabilities such as shared storage and persistent storage.

  • A volume is part of a pod. This means that a volume can be defined only in a pod and cannot be created independently. All containers in a pod can use a volume. However, you must mount the volume to a directory in the container.

  • A volume is a data transfer channel between a pod and an external storage device. A volume enables data sharing between containers in a pod, between pods, and between a pod and an external environment.

  • Volumes are classified into different types, such as EmptyDir, ConfigMap, and PersistentVolumeClaim.

For more information, see Volumes.

PV and PVC

Not all volumes are persistent. To implement persistent storage, container storage relies on a remote storage service. Kubernetes introduces the following resource objects to define and use storage resources: persistent volumes (PVs) and persistent volume claim (PVC).

  • PV

    A PV is an abstract volume that is used to store persistent data. PVs can be network volumes or cloud volumes. A PV can be created in advance by the cluster administrator or dynamically by using StorageClasses. A PV is independent of pods and can be shared by multiple pods.

  • PVC

    A PVC is a storage request from a user, which specifies the capacity and access mode of the PV that a pod needs. PVCs and PVs have a one-to-one correspondence. If you associate a volume with a PVC in a pod, the pod can use the storage resources.

For more information, see Persistent Volumes and Storage Classes.

Select Alibaba Cloud storage services

Alibaba Cloud provides low-cost, high-reliability, and high-availability storage services based on various storage resources, such as blocks, files, and objects. You can select suitable cloud storage services based on the storage requirements of your business load and factors such as data volume, data access frequency, IOPS, and throughput.

Alibaba Cloud storage service

Feature

Scenario

Reference

Cloud disks

Disks are non-shared, low-latency, and high-reliability random block storage. Disks are similar to physical disks, which support partition formatting and the creation of file systems.

  • High I/O and low latency

    Disks feature low latency and high performance. They are suitable for scenarios that have high requirements for I/O and latency, such as scenarios in which databases and middleware are stored.

  • Non-data sharing

    Disks are not shared storage and can be mounted to only one pod.

The following types of disks are supported:

  • cloud_essd_entry: ESSD Entry disk.

  • cloud_auto: ESSD AutoPL disk.

  • cloud_essd: Enterprise SSD (ESSD). This is the default value.

  • cloud_ssd: standard SSD.

  • cloud_efficiency: ultra disk.

You can select disk categories based on your requirements for billing and performance. For more information, see Prices of block storage devices and Block storage performance.

NAS

NAS is a distributed file system that provides multiple benefits. These benefits include parallel shared access, auto scaling, high availability, and high reliability. NAS provides high throughput and high IOPS, and supports random read/write operations and online file modifications.

  • Data sharing

    NAS is a shared storage type. You can access data on NAS volumes from multiple pods at the same time. The data on NAS volumes is not deleted when the pod is deleted. NAS volumes can be used to share data between pods.

  • Big data analysis

    NAS file systems provide high throughput and meet the requirement of shared storage access when large numbers of jobs are involved.

  • Web applications

    NAS file systems can provide storage for web applications and content management systems.

  • Log storage

    If you want to persistently store logs, we recommend that you use NAS.

General-purpose and Extreme NAS file systems are supported.

You can select a appropriate NAS type and the storage specification based on the cost and performance of NAS. For more information, see General-purpose NAS file systems, Extreme NAS file systems, and Select file systems.

CPFS for Lingjun (invitational preview)

Cloud Parallel File Storage (CPFS) for Lingjun provides high throughput and IOPS for intelligent computing scenarios and supports end-to-end Remote Direct Memory Access (RDMA) networks.

  • Intelligent computing scenarios such as AIGC and autonomous driving

    CPFS for Lingjun provides high throughput and IOPS and supports end-to-end RDMA networks to meet the requirements of intelligent computing services.

Only CPFS for Lingjun is supported.

CPFS is in invitational preview and is supported only in specific regions and zones. For more information, see What is CPFS for Lingjun (invitational preview)?

OSS

OSS provides a huge, low-cost, and shared storage space. If you do not need to frequently modify written data, we recommend that you store the data in OSS volumes.

  • Data sharing

    OSS is a shared storage type. You can access data on OSS volumes from multiple pods at the same time. The data on OSS volumes is not deleted when the pod is deleted. OSS volumes can be used to share data between pods.

  • Read-only configuration files of websites and applications

    ossfs provides limited network performance and can be used to read small files.

  • Read-only media files, such as images and audio and video files

    OSS is suitable for storing unstructured data, such as images, audios, and videos.

You can select a storage class based on the billing method and data access frequency. For more information, see Instructions on storage solution selection and Overview.

Use Alibaba Cloud storage services

Volume plug-in

Container Storage Interface (CSI) is a recommended storage plug-in in the Kubernetes community. ACS provides managed-csiprovisioner as the CSI plug-in for ACS clusters, which supports storage volumes based on Alibaba Cloud storage resources.

Important

Before you can use the CSI plug-in to mount, unmount, create, and delete volumes, you must authorize the CSI plug-in to access other Alibaba Cloud services. CSI assumes the AliyunCCCSIPluginRole Resource Access Management (RAM) role to access resources in other Alibaba Cloud services. For more information, see Authorization overview.

Mount method

Use a PV to define Alibaba Cloud storage resources, such as cloud disks and NAS file systems. Bind a PVC to the PV, and specify that the PVC is used in the volume of the pod to mount storage resources. Based on the differences in the creation methods of cloud storage resources and PVs, the methods used to mount cloud storage resources can be divided into the following types:

  • Statically provisioned volume

    Create a PV based on the existing cloud storage resources and bind the PV to the PVC to implement static mounting. This method ensures that the PV is ready before the container is started, which is suitable for scenarios that involve existing storage resources.

  • Dynamically provisioned volume

    You can use a StorageClass to define the cloud storage resources that you want to dynamically create and associate the StorageClass with a PVC. The system automatically creates and binds a PV based on the configurations of the PVC and StorageClass. This mode is more flexible and automated, without the need to create PVs in advance.

The following table describes how to mount different types of volumes.

Alibaba Cloud storage service

Statically provisioned volume

Dynamically provisioned volume

Disks

Not supported

Verify that a dynamically provisioned disk volume can be used to persist data

NAS

Mount a statically provisioned NAS volume

Mount a dynamically provisioned NAS volume

CPFS for LINGJUN

Mount a statically provisioned CPFS volume

Not supported

OSS

Mount a statically provisioned OSS volume

Not supported

Note

In addition to persistent storage, disks can be used as temporary storage volumes to hold ephemeral data. Such storage volumes are created and deleted together with pods. For more information, see Mount ephemeral volumes.