All Products
Search
Document Center

Container Service for Kubernetes:Disk volume overview

Last Updated:Jun 07, 2024

You can mount disk volumes to Container Service for Kubernetes (ACK) clusters. This topic describes the features, disk specifications, use scenarios, usage notes, billing rules, and StorageClasses that are related to disk volumes.

Features

Alibaba Cloud disks are block-level data storage resources for Elastic Compute Service (ECS). Alibaba Cloud disks provide low latency, high performance, high durability, and high reliability. Alibaba Cloud disks use a distributed triplicate mechanism to ensure data reliability for ECS instances. If service disruptions occur within a zone due to hardware errors, data in the zone is automatically replicated to an unaffected disk in another zone to ensure data availability.

  • Enhanced SSDs (ESSDs): ESSDs are based on the next-generation distributed block storage architecture and use the 25 Gigabit Ethernet and remote direct memory access (RDMA) technologies. ESSDs provide low-latency input and output. Each ESSD can provide up to 1,000,000 random read/write IOPS. For more information, see ESSDs.

    We recommend that you use ESSDs for scenarios such as online transactional processing (OLTP) databases, NoSQL databases, and Elasticsearch, Logstash, and Kibana (ELK) distributed logs.

  • Standard SSDs: Standard SSDs are high-performance disks that provide consistent high random IOPS and high data reliability.

    We recommend that you use standard SSDs for scenarios such as I/O-intensive applications, small and medium-sized relational databases, and NoSQL databases.

  • Ultra disks: Ultra disks are cost-effective and provide medium random IOPS and high data reliability.

    We recommend that you use ultra disks as system disks for scenarios such as development and testing.

  • Basic disks: Basic disks are the previous generation of disks and are unavailable for purchase.

Disk types

Item

ESSD AutoPL disk

ESSD

ESSD Entry disk

Standard SSD

Ultra disk

Basic disk

PL3

PL2

PL1

PL0

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

Several 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 the IOPS per disk

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{1,800 + 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 the throughput per disk (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{Throughput 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.

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

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

Use scenarios

The following table describes the operations that you can perform on disks to meet your business requirements.

Business requirement

Reference

Store application data

Resize a system disk or a data disk

For more information about disk expansion, see Overview.

Persistent storage

For more information, see the following topics:

Usage notes

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

  • We recommend that you mount a disk by using a StatefulSet. If you use a Deployment to mount a disk, you must set the number of replicated pods to 1. If the number of replicated pods is not set to 1, multiple nodes may use the disk at the same time when replicated pods are scheduled to different nodes. In this case, you cannot prioritize the node where you want to mount or unmount a disk. When Deployment pods are restarted, disk mounting may fail due to the upgrade policy. Therefore, we recommend that you do not use a Deployment to mount a disk.

  • The type of disk must match the ECS instance types that are used in your cluster before you can mount a disk. For more information about the matching rules between disk types and ECS instance types, see Instance families.

  • You can mount at most 16 disks to each node. The maximum capacity of each disk is 32 TiB.

  • When you mount a disk volume, if the securityContext.fsgroup parameter is set in the application template, kubelet performs the chmod and chown operations after the volume is mounted. This increases the mounting time. For more information about how to reduce the mounting time, see Why does it require a long time to mount a NAS volume? and Why does it require a long period of time to mount an OSS volume?.

Billing rules

  • Only pay-as-you-go disks can be mounted. If you change the billing method of an ECS instance in the cluster from pay-as-you-go to subscription, you cannot change the billing method of its disks to subscription. Otherwise, the disks cannot be mounted to the cluster.

  • For information about the billable items of disks, see EBS billing. For more information about the pricing of disks, visit the ECS product page.

  • If the disk that you want to mount does not support the subscription billing method, you can purchase storage capacity units (SCUs) to reduce the cost. For more information about SCUs, see Introduction to SCUs.

For more information, see Billing.

StorageClasses

If you create a large number of persistent volume claims (PVCs), you must also create a large number of persistent volumes (PVs). This increases the workloads of O&M engineers. To solve this issue, Kubernetes provides the StorageClass object that you can use to enable automatic PV creation.

ACK clusters support the following types of StorageClass:

StorageClass

Description

Recommended scenario

alicloud-disk-efficiency

Ultra disk

Single zone

alicloud-disk-ssd

Standard SSD

Single zone

alicloud-disk-essd

ESSD

Single zone

alicloud-disk-topology-alltype

Provide a high-availability mode. In this mode, the system first attempts to create an ESSD.

  • If ESSDs are out of stock or not supported by the node, the system attempts to create a standard SSD.

  • If standard SSDs are out of stock or not supported by the node, the system attempts to create an ultra disk.

    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: alicloud-disk-topology-alltype
    parameters:
      type: cloud_essd,cloud_ssd,cloud_efficiency
    provisioner: diskplugin.csi.alibabacloud.com
    reclaimPolicy: Delete
    allowVolumeExpansion: true
    volumeBindingMode: WaitForFirstConsumer

Multiple zones

When you configure a StorageClass, the following rules determine the zone where the disk is created:

  • If you set volumeBindingMode: WaitForFirstConsumer in the StorageClass configuration, a disk is created in the zone where the pod is deployed.

  • If you set volumeBindingMode: Immediate and specify only one zone in the zoneId parameter of the StorageClass configuration, a disk is created in the specified zone.

  • If you set volumeBindingMode: Immediate and specify multiple zones in the zoneId parameter of the StorageClass configuration, the system attempts to create a disk in the specified zones in a round robin manner.

If your cluster is deployed across zones, we recommend that you specify volumeBindingMode: WaitForFirstConsumer in the StorageClass configuration. You can create a StorageClass based on the type of disk that is required.

Default StorageClass

Kubernetes provides the default StorageClass feature. If a PVC does not specify a StorageClass, the default StorageClass is used to provision a PV for the PVC. For more information, see Default StorageClass.

Note
  • The default StorageClass takes effect on all PVCs. Proceed with caution if your cluster uses PVCs of different storage types. For example, you want to create a PV for a PVC that defines a NAS file system, but the default StorageClass may automatically create a disk PV instead. Therefore, ACK clusters do not provide default StorageClasses. If you want to configure a default StorageClass, perform the following steps.

  • You can configure only one default StorageClass for each cluster. If you configure more than one default StorageClass for a cluster, all default StorageClasses become invalid.

  1. Run the following command to set alicloud-disk-ssd as the default StorageClass:

    kubectl patch storageclass alicloud-disk-ssd -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

    After the default StorageClass is configured, alicloud-disk-ssd is marked as (default).

    kubectl get sc

    Expected output:

    NAME                          PROVISIONER                       AGE
    alicloud-disk-ssd (default)   diskplugin.csi.alibabacloud.com   96m
  2. Use the default StroageClass.

    Use the following template to create a PVC without specifying a StorageClass:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: disk-pvc
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 20Gi

    The cluster automatically creates a disk PV based on the default StorageClass alicloud-disk-ssd.

    kubectl get pvc

    Expected output:

    NAME       STATUS   VOLUME                   CAPACITY   ACCESS MODES   STORAGECLASS        AGE
    disk-pvc   Bound    d-bp18pbai447qverm3ttq   20Gi       RWO            alicloud-disk-ssd   49s

You can also run the following command to disable the default StorageClass:

kubectl patch storageclass alicloud-disk-ssd -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'