All Products
Search
Document Center

Container Service for Kubernetes:Use ENS disks

Last Updated:Mar 26, 2026

Edge Node Service (ENS) disks provide block storage for ENS nodes in ACK Edge clusters. Using the Container Storage Interface (CSI) driver, you can mount ENS disk volumes through two approaches: dynamic provisioning, where the cluster automatically creates a disk when a PersistentVolumeClaim (PVC) is created; and static provisioning, where you manually bind a pre-existing disk to a PersistentVolume (PV).

Prerequisites

Before you begin, make sure that you have:

Considerations

Hard limits:

  • ENS disks cannot be shared. A disk can be mounted to only one Pod at a time.

  • ENS disks can only be mounted to ENS nodes in the same region as the disk.

  • The only supported reclaim policy is Retain. When you delete a PVC, the PV and disk data are retained and must be deleted manually in the Edge Node Service console.

  • When a Pod is recreated, the system remounts the original disk. If the Pod cannot be scheduled to the original zone, it remains in the Pending state.

  • Dynamic provisioning supports only pay-as-you-go disks. For billing details, see Billing overview.For more information about billing, see Billing of block storage. For pricing details, see the ECS product page.

  • The disk size you specify must fall within the capacity range for the disk type. See Disk types.

How it works

Dynamic provisioning:

  1. You create a StorageClass with the ENS CSI provisioner and a PVC that references it.

  2. When a Pod is scheduled, the CSI driver creates an ENS disk in the zone where the node resides.

  3. The CSI driver provisions a PV and binds it to the PVC.

  4. The disk is attached to the node and mounted into the Pod.

Static provisioning:

  1. You create a PV that references an existing ENS disk ID.

  2. You create a PVC with a label selector that matches the PV.

  3. Kubernetes binds the PVC to the PV.

  4. You deploy a workload that references the PVC, and the disk is mounted into the Pod.

Use dynamic provisioning

Dynamic provisioning automates disk creation and PV binding. Use a StorageClass to provision ENS disks on demand.

Step 1: Create a StorageClass

ENS CSI supports two volume binding modes. Choose one based on your deployment:

Binding modeBehaviorUse when
WaitForFirstConsumer (recommended)Delays disk creation until a Pod is scheduled; creates the disk in the Pod's zoneYour cluster spans multiple regions
ImmediateCreates a disk immediately when the PVC is createdYour cluster is in a single region and you specify regionId

Option 1: WaitForFirstConsumer (recommended)

  1. Create a file named storage-class-topology.yaml with the following content:

    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: alicloud-ens-disk-available
    provisioner: ensplugin.csi.alibabacloud.com
    parameters:
      type: available
      fsType: ext4
    volumeBindingMode: WaitForFirstConsumer
    reclaimPolicy: Retain
    allowVolumeExpansion: false
  2. Apply the StorageClass:

    kubectl apply -f storage-class-topology.yaml
  3. Verify the StorageClass was created:

    kubectl get storageclass alicloud-ens-disk-available

Option 2: Immediate

  1. Create a file named storage-class-csi.yaml with the following content:

    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: alicloud-ens-disk-available
    provisioner: ensplugin.csi.alibabacloud.com
    parameters:
      type: available
      regionId: <your-region-id>
    reclaimPolicy: Retain
    allowVolumeExpansion: false
    volumeBindingMode: Immediate
  2. Apply the StorageClass:

    kubectl apply -f storage-class-csi.yaml
  3. Verify the StorageClass was created:

    kubectl get storageclass alicloud-ens-disk-available

StorageClass parameters:

ParameterValuesDefaultDescription
provisionerensplugin.csi.alibabacloud.comENS CSI driver identifier. Must be set to this value.
typeavailableDisk type to provision.
fsTypeext4ext4Filesystem type to create on the disk.
regionIdA valid ENS region IDOptional. The region where the disk is automatically created.
reclaimPolicyRetainRetainDisk reclaim policy. Only Retain is supported.
volumeBindingModeWaitForFirstConsumer, ImmediateImmediateControls when disk creation and PV binding occur.
allowVolumeExpansionfalsefalseVolume expansion is not supported.

Step 2: Create a PVC

  1. Create a file named pvc-dynamic.yaml with the following content:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: disk-pvc
    spec:
      accessModes:
      - ReadWriteOnce
      volumeMode: Filesystem
      resources:
        requests:
          storage: 25Gi
      storageClassName: alicloud-ens-disk-available
  2. Apply the PVC:

    kubectl create -f pvc-dynamic.yaml
  3. Verify the PVC status:

    kubectl get pvc disk-pvc

    If you used WaitForFirstConsumer, the PVC remains in Pending until a Pod that references it is scheduled. This is expected behavior.

Step 3: Deploy a workload

  1. Create a file named pvc-dynamic-workload.yaml with the following content:

    apiVersion: apps/v1
    kind: StatefulSet
    metadata:
      name: nginx-dynamic
    spec:
      selector:
        matchLabels:
          app: nginx
      template:
        metadata:
          labels:
            app: nginx
        spec:
          containers:
          - name: nginx
            image: nginx
            ports:
            - containerPort: 80
              name: web
            volumeMounts:
            - name: pvc-disk
              mountPath: /tmp
          volumes:
            - name: pvc-disk
              persistentVolumeClaim:
                claimName: disk-pvc
    ParameterDescription
    mountPathPath inside the container where the disk is mounted.
    claimNameName of the PVC to mount. Must match the PVC created in the previous step.
  2. Apply the StatefulSet:

    kubectl create -f pvc-dynamic-workload.yaml
  3. Verify the Pod is running and the PVC is bound:

    kubectl get pods -l app=nginx
    kubectl get pvc disk-pvc

    The PVC status changes to Bound after the Pod is scheduled and the disk is provisioned. Pod scheduling may take a few minutes.

Use static provisioning

Static provisioning lets you mount a pre-existing ENS disk into your workload. Use this approach when you have already created and configured a disk.

Step 1: Create a PV

  1. Create a file named pv-static.yaml with the following content:

    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: csi-pv
      labels:
        alicloud-pvname: static-disk-pv
    spec:
      capacity:
        storage: 25Gi
      accessModes:
        - ReadWriteOnce
      persistentVolumeReclaimPolicy: Retain
      csi:
        driver: ensplugin.csi.alibabacloud.com
        volumeHandle: "<your-disk-id>"    # Replace with your ENS disk ID
      nodeAffinity:
        required:
          nodeSelectorTerms:
          - matchExpressions:
            - key: topology.ensplugin.csi.alibabacloud.com/region
              operator: In
              values:
              - "<your-node-region-id>"  # Run: kubectl get node <node-name> --show-labels
    ParameterDescription
    volumeHandleThe disk ID of the existing ENS disk. Find this in the Edge Node Service console.
    nodeAffinityRestricts the PV to nodes in the specified region. Set to the region of the ENS disk.
    topology.ensplugin.csi.alibabacloud.com/regionThe region ID of the ENS node. Run kubectl get node <node-name> --show-labels to find this value.
  2. Apply the PV:

    kubectl create -f pv-static.yaml
  3. Verify the PV was created:

    kubectl get pv csi-pv

Step 2: Create a PVC

  1. Create a file named pvc-static.yaml with the following content:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: csi-pvc
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 25Gi
      storageClassName: ""
      selector:
        matchLabels:
          alicloud-pvname: static-disk-pv

    The storageClassName: "" tells Kubernetes to bind to a manually created PV rather than using dynamic provisioning. The selector.matchLabels must match the labels on the PV. The claimed storage (25Gi) cannot exceed the PV capacity.

  2. Apply the PVC:

    kubectl create -f pvc-static.yaml
  3. Verify the PVC is bound to the PV:

    kubectl get pvc csi-pvc

    The PVC status should show Bound.

Step 3: Deploy a workload

  1. Create a file named web-static.yaml with the following content:

    apiVersion: apps/v1
    kind: StatefulSet
    metadata:
      name: nginx-static
    spec:
      selector:
        matchLabels:
          app: nginx
      serviceName: "nginx"
      template:
        metadata:
          labels:
            app: nginx
        spec:
          containers:
          - name: nginx
            image: nginx
            ports:
            - containerPort: 80
              name: web
            volumeMounts:
            - name: pvc-disk
              mountPath: /tmp
          volumes:
            - name: pvc-disk
              persistentVolumeClaim:
                claimName: csi-pvc
  2. Apply the StatefulSet:

    kubectl apply -f web-static.yaml
  3. Verify the Pod is running:

    kubectl get pods -l app=nginx
    kubectl get pvc csi-pvc

    When the Pod reaches Running status and the PVC shows Bound, the ENS disk is successfully mounted.

What's next

  • Manage components — Update or uninstall the csi-ens-plugin and csi-ens-provisioner components.

  • Disk types — Review available ENS disk types and their capacity ranges.

  • Billing overview — Understand ENS disk billing for dynamically provisioned volumes.