Help Center> Cloud Container Engine> User Guide> Old Console> Storage (CSI)> EVS Volumes> (kubectl) Automatically Creating an EVS Volume

(kubectl) Automatically Creating an EVS Volume

Scenario

CCE supports creating EVS volumes through PersistentVolumeClaims (PVCs).

Prerequisites

Notes and Constraints

The following configuration example applies to clusters of Kubernetes 1.15 or later.

Procedure

  1. Use kubectl to connect to the cluster. For details, see Connecting to a Cluster Using kubectl.
  2. Run the following commands to configure the pvc-evs-auto-example.yaml file, which is used to create a PVC.

    touch pvc-evs-auto-example.yaml

    vi pvc-evs-auto-example.yaml

    Example YAML file:
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: pvc-evs-auto-example
      namespace: default
      annotations:
        everest.io/disk-volume-type: SSD
      labels:
        failure-domain.beta.kubernetes.io/region: cn-north-4
        failure-domain.beta.kubernetes.io/zone: cn-north-4b
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 10Gi
      storageClassName: csi-disk
    Table 1 Key parameters

    Parameter

    Description

    everest.io/disk-volume-type

    EVS disk type. All letters are in uppercase.

    Supported values: High I/O (SAS) and Ultra-high I/O (SSD)

    failure-domain.beta.kubernetes.io/region

    Region where the cluster is located.

    For details about the value of region, see Regions and Endpoints.

    failure-domain.beta.kubernetes.io/zone

    AZ where the EVS volume is created. It must be the same as the AZ planned for the workload.

    For details about the value of zone, see Regions and Endpoints.

    storage

    Storage capacity in the unit of Gi.

    storageClassName

    Name of the associated Kubernetes storage class that dynamically creates the storage volume.

    Name of the storage class associated with the CSI used by the v1.15 cluster (csi-disk).

    accessModes

    Read/write mode of the volume.

    Clusters of v1.15 support only non-shared volumes. Set this parameter to ReadWriteOnce.

  3. Run the following command to create the PVC.

    kubectl create -f pvc-evs-auto-example.yaml

    After the command is executed, an EVS disk is created in the partition where the cluster is located. Choose Storage > EVS to view the EVS disk. Alternatively, you can view the EVS disk based on the volume name on the EVS console.