Use Alibaba Cloud storage in ACS clusters

Updated at:

ACS container storage uses the Kubernetes Container Storage Interface (CSI) to integrate Alibaba Cloud storage services such as block storage, File Storage NAS, and Object Storage Service (OSS). It is also compatible with native Kubernetes storage types such as EmptyDir and ConfigMap. This topic describes the Alibaba Cloud storage services supported by ACS, including their features, use cases, and how to mount them.

Storage basics

Volume

By default, files inside a container are ephemeral, which presents two problems for applications:

  • When multiple containers run in the same pod, they cannot share files.

  • When a container crashes, its files are lost when it is recreated.

To address these issues, Kubernetes introduces the volume abstraction to provide shared and persistent storage.

  • A volume is part of a pod and is defined within the pod's specification. It cannot be created as a standalone object. All containers in a pod can use its volumes, but each volume must be mounted to a directory within the container.

  • A volume acts as a channel for data transfer between a pod and an external storage device. It also allows data to be shared between containers within a pod, between different pods, or between a pod and the host environment.

  • Kubernetes supports several types of volumes, such as EmptyDir, ConfigMap, and PersistentVolumeClaim (PVC).

For more information, see the official Kubernetes documentation on Volumes.

PV and PVC

Not all volumes are persistent. To provide persistent storage, container storage relies on a remote storage service. For this purpose, Kubernetes introduces two resource objects for managing storage resources: PersistentVolume (PV) and PersistentVolumeClaim (PVC).

  • PersistentVolume (PV)

    A PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned to store persistent data. It is an abstraction for a physical storage resource, such as network storage or cloud storage. A PV can be provisioned by a cluster administrator or created dynamically by using a StorageClass. A PV has a lifecycle independent of any individual pod that uses the PV.

  • PersistentVolumeClaim (PVC)

    A PersistentVolumeClaim (PVC) is a request for storage by a user. It specifies the required capacity and access mode for a PV. A PVC binds to a matching PV in a one-to-one relationship. To use the storage, a pod references the PVC in its volume definition.

For more information, see the official Kubernetes documentation on Persistent Volumes and Storage Classes.

Choose a cloud storage service

Alibaba Cloud provides low-cost, reliable, and highly available storage services for block, file, and object storage. You can choose a suitable cloud storage service based on your workload's compute type and storage requirements, considering factors such as data volume, data access frequency, IOPS, and throughput.

Cloud storage support for different compute types

  • For CPU-based ACS pods (including general-purpose and performance-optimized types), you can mount all types of cloud storage that ACS supports.

  • For GPU-based ACS pods (including GPU and GPU-HPN types), support is as follows:

    • You can mount File Storage NAS, CPFS General-purpose Edition, and OSS.

    • Only some GPU models support mounting block storage and CPFS for Lingjun. For more information, submit a ticket.

Cloud storage features and use cases

Cloud storage

Features

Use cases

Selection guide

Block storage

Non-shared, low-latency, and highly reliable block-level random access storage. Similar to a physical hard drive, it supports partitioning, formatting, and creating file systems.

  • High I/O and low latency

    A disk offers low latency and high performance, making it suitable for applications with demanding I/O and latency requirements, such as databases and middleware.

  • Non-shared access

    A disk provides non-shared storage and can be mounted to only one pod at a time.

The following types of block storage are supported:

  • cloud_essd_entry: ESSD Entry disk

  • cloud_auto: ESSD AutoPL disk

  • cloud_essd (default): ESSD

  • cloud_ssd: standard SSD

  • cloud_efficiency: ultra disk

    You can combine these parameters, for example, type: cloud_efficiency, cloud_ssd, cloud_essd. The system will try to create a disk of each specified type in order until one is created.

Choose a disk type based on your billing and performance needs. For more information, see Prices of block storage devices and Block storage performance.

File Storage NAS

A distributed file system that offers shared access, elastic scaling, high reliability, and high performance. It provides high throughput and IOPS while supporting random reads and writes and online file modifications.

  • Shared data

    NAS is a shared storage type, allowing multiple pods to access the same data simultaneously. Data in NAS persists after pods are deleted, making it ideal for sharing data between pods.

  • Big data analytics

    NAS provides high data throughput, meeting the shared storage access demands of large-scale batch jobs.

  • Web applications

    Provides a storage backend for web applications and content management systems.

  • Log persistence

    For persistent log storage, we recommend using NAS.

Supports General-purpose NAS and Extreme NAS.

You can choose a suitable NAS type and storage plan based on cost and performance. For more information, see General-purpose NAS, Extreme NAS, and Selection guide.

CPFS General-purpose Edition

A fully managed, scalable parallel file system that delivers high throughput and IOPS.

  • High-performance computing (HPC)

    CPFS General Purpose Edition delivers high throughput and high IOPS to meet the demanding requirements of High-Performance Computing (HPC) applications, such as AI training, autonomous driving, genetic computing, and film and television rendering.

You can select a specification based on the cost and performance of CPFS General-purpose Edition. For more information, see Product specifications.

CPFS for Lingjun (invitational preview)

Designed for intelligent computing workloads, it provides ultra-high throughput and IOPS, with support for end-to-end RDMA networking.

  • Intelligent computing workloads

    With its ultra-high throughput, IOPS, and end-to-end RDMA networking, CPFS for Lingjun meets the demanding requirements of intelligent computing workloads such as AIGC and autonomous driving.

CPFS for Lingjun is in an invitational preview and is available only in specific regions and availability zones. For more information, see CPFS for Lingjun.

Object Storage Service (OSS)

OSS provides a low-cost, massive, and shared storage space ideal for data that is written once and seldom modified.

  • Shared data

    OSS provides shared storage. Multiple pods can access the same data simultaneously. Data in OSS persists after pods are deleted, making it suitable for sharing data between pods.

  • Read-mostly scenarios

    OSS is ideal for storing unstructured data such as configuration files, images, and videos. If your application needs to modify file content, use an ossfs 1.0 volume for better POSIX compatibility.

  • High-concurrency batch processing

    The high server-side bandwidth of OSS is suitable for high-concurrency batch processing workloads, such as AI training, data analytics, and autonomous driving. These workloads primarily involve sequential and random reads, and sequential (append-only) writes. Use an ossfs 2.0 volume to achieve higher throughput.

  • Data security with high authorization and DR requirements

    OSS supports disaster recovery across three availability zones and server-side encryption capabilities such as KMS. It also provides MD5 checksums to ensure data integrity during uploads and downloads. Additionally, it supports two object-level authorization methods: RAM and OSS Bucket Policies.

You can select a storage class based on billing methods and data access frequency. For more information, see Selection guide and Storage classes.

Mount a cloud storage volume

Storage plugin

The Container Storage Interface (CSI) is the standard for connecting storage systems to container orchestration systems like Kubernetes. ACS provides csi-provisioner as the CSI plugin for ACS clusters, which supports volumes based on Alibaba Cloud storage resources.

Important

To mount, unmount, create, and delete volumes, the CSI plugin requires permissions to access other Alibaba Cloud services. The plugin gains these permissions by assuming the AliyunCCCSIPluginRole RAM role, allowing it to access your resources in other cloud services. For more information, see Authorization overview.

Mounting methods

You can mount a cloud storage volume by describing the Alibaba Cloud storage resource (such as a disk or a File Storage NAS file system) with a PV, binding the PV with a PVC, and then referencing the PVC in the pod's volume definition. There are two methods for mounting cloud storage, which differ in how the PV is created:

  • Static provisioning

    You create a PV from an existing storage resource (a statically provisioned volume) and then bind it directly in a PVC. This method ensures the PV is ready before the container starts and is ideal for using pre-existing storage.

  • Dynamic provisioning

    You use a StorageClass to define the storage to be created, and then reference that StorageClass in a PVC. The system then automatically creates and binds a PV (a dynamically provisioned volume) based on the PVC and StorageClass configurations. This method is more flexible and automated because it does not require you to create a PV beforehand.

To mount different types of volumes, see the following topics:

Related documentation

  • In addition to persistent storage, disks can be used as ephemeral volumes to store temporary data. These volumes are created and deleted along with their pod. For more information, see Mount an ephemeral volume.

  • By default, each ACS pod is provided with 30 GiB of free temporary storage space (EphemeralStorage). If this is not enough for your needs, you can increase the temporary storage space.