(kubectl) Automatically Creating an EVS Volume
Scenario
CCE supports creating EVS volumes through PersistentVolumeClaims (PVCs).
Prerequisites
- You have created a CCE cluster and installed the CSI plug-in (everest) in the cluster.
- You have configured kubectl for your cluster. For details, see Connecting to a Cluster Using kubectl.
Notes and Constraints
The following configuration example applies to clusters of Kubernetes 1.15 or later.
Procedure
- Use kubectl to connect to the cluster. For details, see Connecting to a Cluster Using kubectl.
- 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-diskTable 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.
- 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.
Last Article: Using EVS Volumes
Next Article: (kubectl) Creating a PV from an Existing EVS Disk
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.