Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com> Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
7.0 KiB
(kubectl) Automatically Creating an EVS Disk
Scenario
CCE supports creating EVS volumes through PersistentVolumeClaims (PVCs).
Prerequisites
You have created a CCE cluster and installed the FlexVolume plug-in (storage-driver) in the cluster.
Notes and Constraints
The following configuration example applies to clusters of Kubernetes 1.13 or earlier.
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 for clusters of v1.9, v1.11, and v1.13:apiVersion: v1 kind: PersistentVolumeClaim metadata: name: pvc-evs-auto-example namespace: default annotations: volume.beta.kubernetes.io/storage-class: sas labels: failure-domain.beta.kubernetes.io/region: eu-de failure-domain.beta.kubernetes.io/zone: eu-de-01 spec: accessModes: - ReadWriteOnce resources: requests: storage: 10Gi
Table 1 Key parameters Parameter
Description
volume.beta.kubernetes.io/storage-class
EVS disk type. The value is in lowercase.
Supported values: Common I/O (SATA), High I/O (SAS), and Ultra-high I/O (SSD)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.
accessModes
Read/write mode of the volume.
You can set this parameter to ReadWriteMany (shared volume) and ReadWriteOnce (non-shared volume).
- Run the following command to create a 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.