You can mount local storage volumes to pods in clusters of Container Service for Kubernetes (ACK). You can also provision local storage volumes as persistent volumes (PVs) and use the CSI plug-in to mount the PVs to pods by using persistent volume claims (PVCs).

Introduction

The storage medium of local volumes can be local disks of Elastic Compute Service (ECS) instances, cloud disks provided by Alibaba Cloud, or memory. For more information, see Local disks and Disks.
  • Local disks are located on the physical machines that host their associated ECS instances. Local disks provide local storage for ECS instances. Local disks are cost-effective and offer high random IOPS, high throughput, and low latency.
  • hostPath: provided by Kubernetes. A hostPath volume mounts a file or directory from the file system of the host node to a pod. hostPath volumes can automatically create a directory if no directory exists in the mount path. Pods that are mounted with hostPath volumes can be scheduled to other nodes.
  • local: provided by Kubernetes. A local volume mounts a local storage device to a pod, such as a disk, partition, or directory. Pods that are mounted with local volumes are scheduled based on scheduling policies configured in the corresponding PV.
  • LV: Logical Volume Manager (LVM) virtualizes local disks by creating volume groups (VGs) and logical volumes (LVs). You can mount LVs to pods.

    Alibaba Cloud uses LVM to support the automatic creation, deletion, and isolation of LVs. Alibaba Cloud also allows you to automate the operations and maintenance (O&M) of VGs, configure the IOPS of LVs, and size the storage capacity of LVs.

  • Memory: memory resources can be virtualized as a tmpfs (RAM-backed filesystem). You can mount a memory volume to provide fast local storage.

Storage specifications

Alibaba Cloud provides the following types of local disks: NVMe SSD and SATA HDD. For more information, see Local NVMe SSDs and Local SATA HDDs.

Scenarios

Local storage is suited for scenarios that require high storage I/O performance, mass storage, and high cost-efficiency.

The following table describes the operations that you can perform on a local storage volume to meet your business requirements.
Operation References
Store application data
  • A hostPath volume mounts a file or directory from the file system of the host node to a pod. For more information, see Use hostPath volumes.
  • A local volume mounts a local storage device to a pod, such as a disk, partition, or directory. For more information, see Use local volumes.
  • After you use VGs to virtualize disks, you can use LVM to divide the VGs into LVs and mount the LVs to pods. For more information, see Use LVs.
  • You can use the project quota feature of file systems on local disks, such as the Ext4 file system. The project quota feature allows you to control the disk quota at the directory level. You can also use the CSI plug-in to manage the lifecycle of QuotaPath volumes, such as division, quota limit, and mounting of QuotaPath volumes. For more information, see Use QuotaPath volumes.
  • memory volumes provide high-performance temporary storage. For more information, see Use memory volumes.

Limits

  • The following types of volumes are supported: hostPath, local, LV, and memory.
  • Local storage volumes do not provide high availability and are applicable to only scenarios where temporary storage is required or where applications can provide high availability.
  • LVs cannot be migrated. Therefore, LVs are not suitable for high availability scenarios.

Billing

Local disks are billed along with the instances to which they are attached. For more information, see Subscription and Pay-as-you-go.