All Products
Search
Document Center

Container Service for Kubernetes:Disk volume overview

Last Updated:Nov 14, 2024

To meet persistent storage requirements, you can mount Alibaba Cloud disks to containers. This prevents data loss caused by container restarts or migrations. The Container Storage Interface (CSI) plug-in allows you to use persistent volume claims (PVCs) to mount statically and dynamically provisioned volumes.

How to select an Alibaba Cloud disk

Alibaba Cloud disks are block-level data storage resources for Elastic Compute Service (ECS), which provide low latency, high performance, high durability, and high reliability. Alibaba Cloud disks are classified based on performance. You can use Enterprise SSD (ESSD) AutoPL disks, ESSDs, ESSD Entry disks, or disks of the previous generation, such as standard SSDs, ultra disks, and basic disks. The following table describes the comparison of different cloud disk types. You can select a disk type based on your business scenario. For more information, see Overview of Block Storage.

Disk Category

Feature

Usage scenario

Billing

ESSD AutoPL disks

  • Decouple disk capacity from disk performance.

  • Support the performance provision feature.

  • Support the performance burst feature.

  • All scenarios for which ESSDs are suitable.

  • Scenarios in which disk performance needs to be increased without the need for disk capacity extension.

  • Scenarios in which business workloads significantly fluctuate and disks need to burst their performance when workload spikes occur.

  • You are charged for disk capacity.

  • You are charged for the provisioned performance on a pay-as-you-go basis after the performance provision feature is enabled.

  • You are charged for the burst performance on a pay-as-you-go basis after the performance burst feature is enabled.

ESSDs

  • Deliver high IOPS.

  • Deliver low latency.

Latency-sensitive applications or I/O-intensive business scenarios, such as:

  • Large-scale online transaction processing (OLTP) databases

  • NoSQL databases

  • Elasticsearch distributed logs

You are charged for disk capacity.

ESSD Entry disks

Note

ESSD Entry disks can be attached only to instances of universal instance families and the e economy instance family.

  • Deliver high IOPS.

  • Deliver low latency.

  • Development and testing business

  • Usage as system disks.

You are charged for disk capacity.

Cloud disks of the previous generation

Standard SSDs, ultra disks, and basic disks are cloud disks of the previous generation and are unavailable for purchase in specific regions and zones. We recommend that you use ESSDs at performance level 0 (PL0 ESSDs) or ESSD Entry disks instead of ultra disks and basic disks and use ESSD AutoPL disks instead of standard SSDs.

Cloud disk category

Feature

Usage scenario

Billing

Standard SSDs

  • Deliver high random read/write performance.

  • Provide high reliability.

  • I/O-intensive applications

  • Small and medium-sized relational databases and NoSQL databases

You are charged for disk capacity.

Ultra disks

  • Deliver high cost efficiency.

  • Provide high reliability.

  • Development and testing business

  • Usage as system disks.

You are charged for disk capacity.

Basic disks

Deliver high cost efficiency.

Low-cost development and testing business that does not require high storage performance

You are charged for disk capacity.

Limits

Item

Description

Disk category

You cannot mount or unmount subscription disks. Use pay-as-you-go disks or use disks together with storage capacity units (SCUs).

Whether it can be shared

Alibaba Cloud disks cannot be shared. Each disk can be mounted to only one pod.

Relationship with ECS instances

  • A disk can be mounted only to an ECS instance that resides in the same zone as the disk. Cross-zone mounting is not supported.

  • Before you can mount a disk, make sure that the disk type matches the ECS instance type used in your cluster. Ultra disks cannot be used in ECS instances of the seventh generation or later. For more information about disk types supported by each ECS instance type, see Overview of instance families.

Number of mounted disks and disk capacity

  • The maximum number of disks that can be mounted to a node depends on the instance type of the node. For more information, see Overview of instance families.

  • The minimum capacity of a single PL0 Enterprise SSD (ESSD) or ESSD AutoPL disk is 1 GiB and the maximum capacity is 32 TiB, which equals to 32,768 GiB.

Application type

Mount a disk to a StatefulSet.

Note

If you mount a disk to a Deployment, you must set the number of replicated pods to 1. In this case, you cannot configure an independent persistent volume (PV) for each pod or prioritize the node on which you want to mount or unmount a disk. If the pods of the Deployment are restarted, disk mounting may fail due to the update policy. We recommend that you do not mount a disk to a Deployment.

Configure Application Parameters

If you configure the securityContext.fsgroup parameter in the application template, the kubelet performs the chmod and chown operations after a disk volume is mounted, which may increase the mounting time. For more information about how to reduce the mounting time, see Cause 3 in the Why does the system prompt Unable to attach or mount volumes: unmounted volumes=[xxx], unattached volumes=[xxx]: timed out waiting for the condition when I start a pod that uses a disk volume? section.

Disk types

Performance indicator

ESSD AutoPL disk

ESSD

ESSD Entry disk

Standard SSD

Ultra disk

Basic disk

Performance Level

An ESSD AutoPL disk can decouple capacity from performance and deliver baseline performance that is equal to the baseline performance of an ESSD PL1 disk. You can configure provisioned performance and burst performance for ESSD AutoPL disks.

PL3

PL2

PL1

PL0

None

None

None

None

Single-disk capacity range (GiB)

1~65,536

1,261~65,536

461~65,536

20~65,536

1~65,536

10~32,768

20~32,768

20~32,768

5~2,000

Max IOPS/Min IOPS

1,000,000/3,000

1,000,000/64,850

100,000/24,872

50,000/2,800

10,000/1,812

6,000/1,880

25,000/2,400

5,000/1,960

Hundreds

Max throughput/Min throughput (MB/s)

4,096/125

4,000/750.5

750/350.5

350/130

180/100

150/101.5

300/130

140/103

30~40

Formula for calculating single-disk IOPS

Baseline performance:

max{min{1,800 + 50 × Capacity, 50,000}, 3,000}

Provisioned performance: min{Provisioned IOPS, 50,000}

Burst performance: min{IOPS supported by the instance type, 1,000,000}

min{1,800 + 50 × Capacity, 1,000,000}

min{1,800 + 50 × Capacity, 100,000}

min{1800 + 50 × Capacity, 50,000}

min{1,800+12 × Capacity, 10,000}

min{1,800 + 8 × Capacity, 6,000}

min{1,800 + 30 × Capacity, 25,000}

min{1,800 + 8 × Capacity, 5,000}

None

Formula for calculating single-disk throughput (MB/s)

Baseline performance:

max{min{120 + 0.5 × Capacity, 350}, 125}

Provisioned performance: min{16 KB × Provisioned IOPS/1,024, Maximum throughput per disk}

Burst performance: min{Throughout supported by the instance type, 4 GB/s}

min{120 + 0.5 × Capacity, 4,000}

min{120 + 0.5 × Capacity, 750}

min{120 + 0.5 × Capacity, 350}

min{100 + 0.25 × Capacity, 180}

min{100 + 0.15 × Capacity, 150}

min{120 + 0.5 × Capacity, 300}

min{100 + 0.15 × Capacity, 140}

None

Data reliability

99.9999999%

99.9999999%

99.9999999%

99.9999999%

99.9999999%

99.9999999%

99.9999999%

99.9999999%

99.9999999%

Average one-way random write latency in milliseconds (block size = 4 KB)

0.2

0.2

0.2

0.2

0.3~0.5

1~3

0.5~2

1~3

5~10

API parameter value

cloud_auto

cloud_essd

cloud_essd

cloud_essd

cloud_essd

cloud_essd_entry

cloud_ssd

cloud_efficiency

cloud

  • In the following examples, a PL0 ESSD is used to describe how to calculate single-disk performance:

    • Single-disk maximum IOPS: The baseline IOPS is 1,800 and increases by 12 per additional GiB to up to 10,000.

    • Single-disk maximum throughput: The baseline throughput is 100 MB/s and increases by 0.25 MB/s per additional GiB to up to 180 MB/s.

  • The performance of standard SSDs varies based on the size of data blocks. Standard SSDs that contain smaller data blocks deliver lower throughput and higher IOPS. The following table provides a comparison of data blocks.

    Data block size (KiB)

    Maximum IOPS

    Throughput (MB/s)

    4

    Approximately 25,000

    Approximately 100

    16

    Approximately 17,200

    Approximately 260

    32

    Approximately 9,600

    Approximately 300

    64

    Approximately 4,800

    Approximately 300

Note

For more information about disk performance, see Block storage performance.

Use scenarios

  • Applications with high disk I/O requirements that do not need to share data, such as MySQL, Redis, and other data storage services.

  • High-speed log writing.

  • Data persistence by using a method that is independent of the pod lifecycle.

Business requirement

Description

References

Store application data

  • Statically provisioned disk volumes: If the disk that you created meets the limits, you can use the disk to create a PV and mount the PV to the workload by using the PVC. Statically provisioned disk volumes cannot be expanded.

  • Dynamically provisioned disk volumes: You do not need to create disks in advance. You can specify a StorageClass when you create a PVC. Then, the system automatically purchases a disk and provisions a PV. Dynamically provisioned disk volumes can be expanded.

Insufficient disk capacity

If you use a dynamically provisioned disk volume and the disk space is insufficient, you can use one of the following methods to expand the disk: For more information, see Overview.

  • Expansion without service interruptions: You can expand a disk volume and its file system without service interruptions.

  • Manual expansion: You can manually expand a disk volume and run the resize2fs command to manually expand the file system.

  • Automatic expansion: You can configure one or more expansion policies to automatically expand a disk volume when the usage of the disk volume exceeds the specified threshold.

Change the type of a cloud disk

If your business scenario requires disk expansion and your application requires a higher IOPS, you can upgrade the disk. For example, you can upgrade the disk from standard SSD to ESSD.

Change the type of a cloud disk

Back up disk data

Integrate the disk backup (volume snapshots) and restoration mechanism with Container Service for Kubernetes (ACK), and create volume snapshots by using VolumeSnapshots. Restore data by setting dataSource to the related PVC.

Use volume snapshots created from disks

Encrypt disk data

Disk encryption is suitable for scenarios that require high security or have compliance requirements. You can protect the privacy and autonomy of your data without the need to create and maintain a key management infrastructure.

Ensure data security of cloud storage

If data corruption occurs when you expand an ESSD without service interruptions or data loss occurs due to an accidental ESSD deletion, you can use the instant access (IA) snapshot feature of ESSDs to restore the data in the ESSD.

Best practices for data security of disk volumes

Billing

  • Only pay-as-you-go disks can be mounted. When you change the billing method of an ECS instance in your cluster from pay-as-you-go to subscription, you cannot change the billing method of the mounted disks to subscription. Otherwise, the disks cannot be mounted to the cluster. You can purchase SCUs to reduce the disk cost. For more information about SCUs, see SCUs.

  • StorageClasses are free of charge. Disks that are automatically created by using StorageClasses are billed based on a pay-as-you-go basis.

  • For information about the billable items of disks, see Block storage devices. For more information about the pricing of disks, visit the ECS product page.

For more information, see Billing.

FAQ

If issues occur when you use disk volumes mounted to containers, see FAQ about disk volumes.

References

  • You can use the CSI plug-in to create, mount, and unmount volumes. For more information, see Manage the CSI plug-in.

  • If you require different types of storage resources, you can define multiple types of StorageClasses. For more information, see StorageClass.