All Products
Search
Document Center

Container Service for Kubernetes:Use a dynamically provisioned disk volume in the ACK console

Last Updated:Mar 26, 2026

Stateful applications on Kubernetes need storage that persists beyond the pod lifecycle. This topic walks you through the end-to-end workflow for dynamically provisioning a cloud disk volume in the Container Service for Kubernetes (ACK) console: creating a StorageClass, creating a persistent volume claim (PVC), and mounting the volume in a StatefulSet workload.

Prerequisites

Before you begin, ensure that you have:

Step 1: Create a StorageClass

A StorageClass defines how ACK provisions cloud disk volumes on demand. If your cluster already has a suitable StorageClass, skip this step and proceed to Step 2: Create a PVC.

  1. Log on to the ACK console and click ACK consoleACK consoleACK consoleClusters in the left-side navigation pane.

  2. Click the name of your cluster. In the left-side pane, choose Volumes > StorageClasses.

  3. On the StorageClasses page, click Create. In the Create dialog box, configure the following parameters.

    ParameterDescription
    NameThe name of the StorageClass.
    PV TypeSet to Cloud Disk.
    Volume Plug-inThe storage plugin. This example uses Flexvolume.
    ParameterKey-value pairs passed to the provisioner. See StorageClass parameters below.
    Reclaim PolicyThe policy applied to the cloud disk when the PVC is deleted. Default: Delete. Set to Retain to preserve data if the PVC is accidentally deleted.
    Binding ModeControls when volume binding occurs. Immediate (default): binds as soon as the PVC is created. WaitForFirstConsumer: delays binding until a pod using the PVC is scheduled.
    Mount OptionsAdditional options passed to the mount command. Multiple options are supported.
  4. Click Create. The StorageClass appears in the StorageClasses list.

StorageClass parameters

The Parameter field accepts key-value pairs. The following parameters are supported for cloud disk volumes:

ParameterValid valuesDescription
typecloud_efficiency, cloud_ssd, cloud_essd, availableThe cloud disk type. If set to available, ACK tries disk types in this order: enhanced SSD (ESSD), standard SSD, and ultra disk, until one is successfully provisioned.
zoneidZone IDs, comma-separated for multi-zone clustersThe zone where the disk is created. For multi-zone clusters, specify multiple zones. Example: cn-hangzhou-a,cn-hangzhou-b,cn-hangzhou-c.
encryptedtrue, falseWhether to encrypt the disk. Default: false.

Step 2: Create a PVC

A PVC requests storage from the StorageClass. ACK automatically provisions a persistent volume (PV) to satisfy the request.

  1. Log on to the ACK console and click Clusters in the left-side navigation pane.

  2. Click the name of your cluster. In the left-side pane, choose Volumes > Persistent Volume Claims.

  3. On the Persistent Volume Claims page, click Create. In the Create PVC dialog box, configure the following parameters.

    ParameterDescription
    PVC TypeSelect Cloud Disk. NAS and OSS are also supported.
    NameThe name of the PVC. Must be unique within the namespace.
    Allocation ModeSelect Use StorageClass to dynamically provision a new volume. Alternatively, select Existing Volumes to bind an existing PV, or Create Volume to provision a volume directly.
    Existing Storage ClassClick Select, find the StorageClass created in Step 1, and click Select in the Actions column.
    CapacityThe storage size to request. Must not exceed the disk capacity.
    Access ModeDefault: ReadWriteOnce (the volume can be mounted as read-write by a single node at a time).
  4. Click Create. After the PVC is created, the PVC (for example, test-cloud) appears in the list of PVCs. The PVC is associated with the specified persistent volume (PV).

Step 3: Create a workload and mount the volume

Mount the PVC to a StatefulSet so that data written to the mount path persists in the cloud disk.

  1. Log on to the ACK console and click Clusters in the left-side navigation pane.

  2. Click the name of your cluster. In the left-side pane, choose Workloads > StatefulSets.

  3. In the upper-right corner, click Create from Image.

  4. In the Data Volumes section, you can add local storage, PVCs, or PVC templates. In this example, add a PVC volume and set the mount path. This example mounts the PVC to /tmp in the container — data written to /tmp is stored in the cloud disk. For other workload parameters, see Create a stateless application by using a Deployment.

    Configure data volumes

  5. Complete the remaining configuration and click Create. After the workload starts, the cloud disk volume is mounted and ready to use.

What's next