Configuring a VolumeSnapshotClass
Creating a VolumeSnapshotClass
VolumeSnapshotClass provides a way to describe the “classes” of storage when provisioning a VolumeSnapshot. Each VolumeSnapshotClass contains the driver, deletionPolicy, and parameters fields, which are used when a VolumeSnapshot belonging to the class needs to be dynamically provisioned.
The name of a VolumeSnapshotClass object is significant, and is how users can request a particular class. Administrators set the name and other parameters of a class when first creating VolumeSnapshotClass objects, and the objects cannot be updated once they are created.
The following is an example of a VolumeSnapshotClass used by Huawei CSI:
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: mysnapclass
driver: csi.huawei.com
deletionPolicy: Delete
You can modify the parameters according to Table 1 .
Table 1 VolumeSnapshotClass parameters
Procedure
Run the following command to create a VolumeSnapshotClass using the created VolumeSnapshotClass configuration file.
kubectl create -f mysnapclass.yamlRun the following command to view the information about the created VolumeSnapshotClass.
kubectl get volumesnapshotclassThe following is an example of the command output.
NAME DRIVER DELETIONPOLICY AGE mysnapclass csi.huawei.com Delete 25s