A StorageClass provides administrators with methods to describe a storage “class”. Different types may map to a different group of capability definitions. Kubernetes cluster users can dynamically provision volumes based on a StorageClass.
This is the multi-page printable view of this section. Click here to print.
StorageClass Management
- 1: Configuring a StorageClass
- 1.1: Flash Storage (OceanStor Dorado/OceanStor V5/OceanStor V6 and Later)
- 1.1.1: File System
- 1.1.2: Dtree
- 1.1.3: Block Service
- 1.2: Flash Storage (OceanStor A600/A800)
- 1.2.1: File System
- 1.3: Mass Storage (FusionStorage Block/OceanStor Pacific Series)
- 1.3.1: File System
- 1.3.2: Dtree
- 1.3.3: Block Services
- 1.4: Mass Storage (OceanDisk Series)
- 1.4.1: File System
- 1.4.2: Block Services
- 2: Managing a StorageClass
1 - Configuring a StorageClass
Cluster administrators can define multiple StorageClass objects as required. When configuring a PV, the cluster administrators need to specify a StorageClass that meets service requirements. When applying for resources from Huawei storage devices, Huawei CSI creates storage resources that meet service requirements based on the preset StorageClass.
1.1 - Flash Storage (OceanStor Dorado/OceanStor V5/OceanStor V6 and Later)
1.1.1 - File System
Creating a StorageClass
Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.
Run the following command to create a StorageClass using the configuration file.
kubectl apply -f mysc.yamlRun the following command to view the information about the created StorageClass.
kubectl get sc myscThe following is an example of the command output.
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mysc csi.huawei.com Delete Immediate true 8s
NFS Protocol Configuration Example
When a container uses the NFS protocol to connect to file system resources, refer to the following StorageClass configuration example. In this example, NFS version 4.1 is specified for mounting.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: nfs-nas-181
pool: StoragePool001
volumeType: fs
allocType: thin
authClient: "*"
mountOptions:
- nfsvers=4.1 # Specify the version 4.1 for NFS mounting.
NFS+ Protocol Configuration Example
When a container uses the NFS+ protocol to connect to file system resources, refer to the following StorageClass configuration example.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: nfs-nas-181
pool: StoragePool001
volumeType: fs
allocType: thin
authClient: "*"
HyperMetro File System Configuration Example
When a container uses an NFS HyperMetro file system as a storage resource, refer to the following configuration example. In this example, the used backend supports HyperMetro, and hyperMetro is set to true.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: nfs-hypermetro-dorado-181
pool: pool001
volumeType: fs
hyperMetro: "true" # Provision HyperMetro volumes.
allocType: thin
authClient: "*"
- Before provisioning a NAS HyperMetro volume, you need to configure the HyperMetro relationship between two storage devices, including the remote device and HyperMetro domain. The HyperMetro domain of the file system can only work in HyperMetro AA mode. For details about the configuration operation, see the product documentation of the corresponding storage model.
- If a storage device is faulty, the logical management port may fail over. In this case, you need to manually clear the corresponding storage resources after deleting the NAS HyperMetro volume.
StorageClass Parameters Supported by File Systems
Table 1 StorageClass configuration parameters
Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit. | |||||
Set this parameter to the driver name set during Huawei CSI installation. The value is the same as that of driverName in the values.yaml file. | |||||
Reclamation policy. The following types are supported: | |||||
Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded. | This function can only be used to expand PV capacity but cannot be used to reduce PV capacity. | ||||
List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host. | For details about common parameters in mountOptions, see Table 2. | ||||
Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set. | If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources. You are advised to specify a backend to ensure that the created resource is located on the expected backend. | ||||
Name of the storage resource pool where the resource to be created is located. | If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool. | ||||
Name of the storage resource created by dynamic volume provisioning. You can configure a placeholder to customize the storage resource name. The following placeholders are supported:
|
PVC namespace: namespace. PVC name: pvc-1. PVC UID: c2fd3f46-bf17-4a7d-b88e-2e3232bae434. volumeName is set to prefix-{{ .PVCNamespace }}_{{ .PVCName }}. The ultimate storage resource name is prefix-namespace_pvc-1-c2fd3f46bf174a7db88e2e3232bae434. | ||||
Type of the volume to be created. The following types are supported: | |||||
Allocation type of the volume to be created. The following types are supported: | If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage. | ||||
IP address of the NFS client that can access the volume. You can enter the client host name (a full domain name is recommended), client IP address, or client IP address segment. | The asterisk (*) can be used to indicate any client. If you are not sure about the IP address of the access client, you are advised to use the asterisk (*) to prevent the client access from being rejected by the storage system. If the client host name is used, you are advised to use the full domain name. The IP addresses can be IPv4 addresses, IPv6 addresses, or a combination of IPv4 and IPv6 addresses. You can enter multiple host names, IP addresses, or IP address segments and separate them with semicolons (;). Example: 192.168.0.10;192.168.0.0/24;myserver1.test | ||||
4 indicates the highest speed. This parameter takes effect when a persistent volume is cloned or a persistent volume is created from a snapshot. | |||||
Log in to DeviceManager and choose Services > File Service > File Systems > Create to obtain the application type name. | |||||
QoS settings of the file system on the storage side for the PV. The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"maxMBPS": 999, "maxIOPS": 999}' | For details about the supported QoS configurations, see Table 3. | ||||
Whether a HyperMetro volume is to be created. This parameter needs to be configured when the backend is of the HyperMetro type. | When the used backend is a HyperMetro backend and a HyperMetro volume needs to be provisioned, set this parameter to true. If this parameter is set to false, services may be interrupted if the logical management port connected to the backend fails over. | ||||
Data synchronization speed of a HyperMetro pair. The value ranges from 1 to 4. | The configuration takes effect when a HyperMetro volume is created.
| ||||
For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755. | |||||
Controls the root permission of the client. | |||||
Whether to retain the user ID (UID) and group ID (GID) of a shared directory. | |||||
Configures the krb5 security protocol. | During mounting, you can specify the sec parameter in mountOptions. | ||||
Configures the krb5i security protocol. | During mounting, you can specify the sec parameter in mountOptions. | ||||
Configures the krb5p security protocol. | During mounting, you can specify the sec parameter in mountOptions. | ||||
Whether the snapshot directory is visible. | |||||
OceanStor Dorado 6.1.5+ and OceanStor 6.1.5+ NAS storage devices are supported. | |||||
Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.
| For OceanStor Dorado and OceanStor storage, the sector size is 512 bytes. | ||||
Advanced volume creation parameters. The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"CAPACITYTHRESHOLD": 90}' | For details about the supported advanced parameters, see Table 4. |
Table 2 Common parameters in mountOptions
Table 3 Supported QoS configurations
Table 4 Supported advanced volume creation parameters
For details about the default value and value range, see the corresponding storage product manual. |
1.1.2 - Dtree
Creating a StorageClass
Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.
Run the following command to create a StorageClass using the configuration file.
kubectl apply -f mysc.yamlRun the following command to view the information about the created StorageClass.
kubectl get sc myscThe following is an example of the command output.
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mysc csi.huawei.com Delete Immediate true 8s
Example of StorageClass Configuration Supported by the NFS Protocol
When a container uses the NFS protocol to connect to dtree resources, refer to the following StorageClass configuration example. In this example, NFS version 4.1 is specified for mounting.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: nfs-dtree-181
parentname: parent-filesystem-name
volumeType: dtree
allocType: thin
authClient: "*"
mountOptions:
- nfsvers=4.1 # Specify the version 4.1 for NFS mounting.
Example of StorageClass Configuration Supported by the NFS+ Protocol
When a container uses the NFS+ protocol to connect to dtree resources, refer to the following StorageClass configuration example.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: nfs-dtree-181
parentname: parent-filesystem-name
volumeType: dtree
allocType: thin
authClient: "*"
Storage Class Parameters Supported by Dtrees
Table 1 StorageClass configuration parameters
Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit. | ||||
Set this parameter to the driver name set during Huawei CSI installation. The value is the same as that of driverName in the values.yaml file. | ||||
Reclamation policy. The following types are supported: | ||||
Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded. | This function can only be used to expand PV capacity but cannot be used to reduce PV capacity. | |||
List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host. | For details about common parameters in mountOptions, see Table 2. | |||
Name of the backend where the resource to be created is located. | If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources. You are advised to specify a backend to ensure that the created resource is located on the expected backend. This parameter is mandatory if parameters.parentname is configured. | |||
Name of a file system on the current storage device. Dtree is created in the file system. | This parameter is mandatory when parentname is not configured for the backend. If parentname is configured only in the StorageClass but not configured in the storage backend, set CSIDriverObject.attachRequired to true during CSI installation. | |||
Name of the storage resource created by dynamic volume provisioning. You can configure a placeholder to customize the storage resource name. The following placeholders are supported:
|
PVC namespace: namespace. PVC name: pvc-1. PVC UID: c2fd3f46-bf17-4a7d-b88e-2e3232bae434. volumeName is set to prefix-{{ .PVCNamespace }}_{{ .PVCName }}. The ultimate storage resource name is prefix-namespace_pvc-1-c2fd3f46bf174a7db88e2e3232bae434. | |||
Type of the volume to be created. The following types are supported: | ||||
IP address of the NFS client that can access the volume. You can enter the client host name (a full domain name is recommended), client IP address, or client IP address segment. | The asterisk (*) can be used to indicate any client. If you are not sure about the IP address of the access client, you are advised to use the asterisk (*) to prevent the client access from being rejected by the storage system. If the client host name is used, you are advised to use the full domain name. The IP addresses can be IPv4 addresses, IPv6 addresses, or a combination of IPv4 and IPv6 addresses. You can enter multiple host names, IP addresses, or IP address segments and separate them with semicolons (;). Example: 192.168.0.10;192.168.0.0/24;myserver1.test | |||
For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755. | ||||
Controls the root permission of the client. | ||||
Whether to retain the user ID (UID) and group ID (GID) of a shared directory. | ||||
Configures the krb5 security protocol. | During mounting, you can specify the sec parameter in mountOptions. | |||
Configures the krb5i security protocol. | During mounting, you can specify the sec parameter in mountOptions. | |||
Configures the krb5p security protocol. | During mounting, you can specify the sec parameter in mountOptions. | |||
Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.
| For OceanStor Dorado and OceanStor storage, the sector size is 512 bytes. | |||
Table 2 Common parameters in mountOptions
1.1.3 - Block Service
Creating a StorageClass
Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.
Run the following command to create a StorageClass using the configuration file.
kubectl apply -f mysc.yamlRun the following command to view the information about the created StorageClass.
kubectl get sc myscThe following is an example of the command output.
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mysc csi.huawei.com Delete Immediate true 8s
Block Storage Class Configuration Example
If LUNs are used as storage resources and the file system needs to be formatted to a local file system, refer to the following example.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: lun-181
pool: StoragePool001
volumeType: lun
allocType: thin
fsType: ext4
StorageClass Parameters Supported by Block Services
Table 1 StorageClass configuration parameters
Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit. | |||||
Set this parameter to the driver name set during Huawei CSI installation. The value is the same as that of driverName in the values.yaml file. | |||||
Reclamation policy. The following types are supported: | |||||
Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded. | This function can only be used to expand PV capacity but cannot be used to reduce PV capacity. | ||||
List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host. | For details about common parameters in mountOptions, see Table 2. | ||||
Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set. | If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources. You are advised to specify a backend to ensure that the created resource is located on the expected backend. | ||||
Name of the storage resource pool where the resource to be created is located. | If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool. | ||||
Name of the storage resource created by dynamic volume provisioning. You can configure a placeholder to customize the storage resource name. The following placeholders are supported:
|
PVC namespace: namespace. PVC name: pvc-1. PVC UID: c2fd3f46-bf17-4a7d-b88e-2e3232bae434. volumeName is set to prefix-{{ .PVCNamespace }}_{{ .PVCName }}. The ultimate storage resource name is prefix-namespace_pvc-1-c2fd3f46bf174a7db88e2e3232bae434. | ||||
Type of the volume to be created. The following types are supported: | |||||
Allocation type of the volume to be created. The following types are supported: | If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage. | ||||
Type of a host file system. The supported types are:
| This parameter is available only when volumeMode of the PVC is set to Filesystem. | ||||
4 indicates the highest speed. This parameter takes effect when a PVC is cloned or a PVC is created from a snapshot. | |||||
Log in to DeviceManager and choose Services > Block Service > LUN Groups (or Namespace Groups) > LUNs (or Namespaces) > Create to obtain the application type name. | |||||
LUN/NAS QoS settings of the PV on the storage side. The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"maxMBPS": 999, "maxIOPS": 999}' | For details about the supported QoS configurations, see Table 3. | ||||
For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755. | |||||
Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.
| For OceanStor Dorado and OceanStor storage, the sector size is 512 bytes. | ||||
Table 2 Common parameters in mountOptions
Automatically triggers the Trim or Discard operation when a file system is mounted. This operation instructs a block device to release unused blocks. |
Table 3 Supported QoS configurations
The value is an integer ranging from 1 to 999999999, expressed in MB/s. | ||
The value is an integer ranging from 1 to 999999999, expressed in MB/s. | ||
1.2 - Flash Storage (OceanStor A600/A800)
1.2.1 - File System
Creating a StorageClass
Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.
Run the following command to create a StorageClass using the configuration file.
kubectl apply -f mysc.yamlRun the following command to view the information about the created StorageClass.
kubectl get sc myscThe following is an example of the command output.
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mysc csi.huawei.com Delete Immediate true 8s
NFS Protocol Configuration Example
When a container uses the NFS protocol to connect to file system resources, refer to the following StorageClass configuration example. In this example, NFS version 4.1 is specified for mounting.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: nfs-nas-181
pool: StoragePool001
volumeType: fs
allocType: thin
authClient: "*"
mountOptions:
- nfsvers=4.1 # Specify the version 4.1 for NFS mounting.
DataTurbo Protocol Configuration Example
If a container uses OceanStor A series storage and the storage supports DataTurbo-based access, you can refer to the following configuration example. In this example, the DataTurbo share user name is user01.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: dtfs-nas-181
pool: pool001
volumeType: fs
allocType: thin
authUser: user01
StorageClass Parameters Supported by File Services
Table 1 StorageClass configuration parameters
Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit. | |||||
Set this parameter to the driver name set during Huawei CSI installation. The value is the same as that of driverName in the values.yaml file. | |||||
Reclamation policy. The following types are supported: | |||||
Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded. | This function can only be used to expand PV capacity but cannot be used to reduce PV capacity. | ||||
List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host. | For details about common parameters in mountOptions, see Table 2. | ||||
Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set. | If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources. You are advised to specify a backend to ensure that the created resource is located on the expected backend. | ||||
Name of the storage resource pool where the resource to be created is located. | If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool. | ||||
Name of the storage resource created by dynamic volume provisioning. You can configure a placeholder to customize the storage resource name. The following placeholders are supported:
|
PVC namespace: namespace. PVC name: pvc-1. PVC UID: c2fd3f46-bf17-4a7d-b88e-2e3232bae434. volumeName is set to prefix-{{ .PVCNamespace }}_{{ .PVCName }}. The ultimate storage resource name is prefix-namespace_pvc-1-c2fd3f46bf174a7db88e2e3232bae434. | ||||
Type of the volume to be created. The following types are supported: | |||||
Allocation type of the volume to be created. The following types are supported: | If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage. | ||||
IP address of the NFS client that can access the volume. This parameter is mandatory when the nfs or nfs+ protocol is used. You can enter the client host name (a full domain name is recommended), client IP address, or client IP address segment. | The asterisk (*) can be used to indicate any client. If you are not sure about the IP address of the access client, you are advised to use the asterisk (*) to prevent the client access from being rejected by the storage system. If the client host name is used, you are advised to use the full domain name. The IP addresses can be IPv4 addresses, IPv6 addresses, or a combination of IPv4 and IPv6 addresses. You can enter multiple host names, IP addresses, or IP address segments and separate them with semicolons (;). Example: 192.168.0.10;192.168.0.0/24;myserver1.test | ||||
DataTurbo user who can access the DataTurbo share. This parameter is mandatory when the DataTurbo(dtfs) protocol is used. | You can enter multiple DataTurbo users at a time and separate them with semicolons (;). Example: auth_user1;auth_user2;auth_user3 | ||||
Log in to DeviceManager and choose Services > File Service > File Systems > Create to obtain the application type name. | |||||
For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755. | |||||
Controls the root permission of the client. | |||||
Whether to retain the user ID (UID) and group ID (GID) of a shared directory. | |||||
Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.
| |||||
Advanced volume creation parameters. The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"CAPACITYTHRESHOLD": 90}' | For details about the supported advanced parameters, see Table 3. |
Table 2 Common parameters in mountOptions
NFS mount option on the host. The following mount option is supported: nfsvers: protocol version for NFS mounting. The value can be 3, 4, 4.0, 4.1, or 4.2. | This parameter is optional after the -o parameter when the mount command is executed on the host. The value is in list format. If the NFS version is specified for mounting, NFS 3, 4.0, 4.1, and 4.2 protocols are supported (the protocol must be supported and enabled on storage devices). If nfsvers is set to 4, the latest protocol version NFS 4 may be used for mounting due to different OS configurations, for example, 4.2. If the 4.0 protocol is required, you are advised to set nfsvers to 4.0. | |||
Domain name of the logical port used for mounting when the DataTurbo(dtfs) protocol is used. | To mount the HyperScale cluster file system, enter the domain name of the HyperScale cluster. The description of the dn parameter is for reference only. For details about other mounting parameters of the DataTurbo protocol, see OceanStor DataTurbo DTFS User Guide. |
Table 3 Supported advanced volume creation parameters
For details about the default value and value range, see the corresponding storage product manual. |
1.3 - Mass Storage (FusionStorage Block/OceanStor Pacific Series)
1.3.1 - File System
Creating a StorageClass
Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.
Run the following command to create a StorageClass using the configuration file.
kubectl apply -f mysc.yamlRun the following command to view the information about the created StorageClass.
kubectl get sc myscThe following is an example of the command output.
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mysc csi.huawei.com Delete Immediate true 8s
NFS Protocol Configuration Example
When a container uses the NFS protocol to connect to file system resources, refer to the following StorageClass configuration example. In this example, NFS version 4.1 is specified for mounting.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: nfs-nas-181
pool: pool001
volumeType: fs
allocType: thin
authClient: "*"
mountOptions:
- nfsvers=4.1 # Specify the version 4.1 for NFS mounting.
DPC Protocol Configuration Example
When the storage supports access using the DPC protocol, you can configure the mount parameters for DPC access in the StorageClass. In this example, acl is used as the authentication parameter for mounting, and cnflush is used to set the asynchronous disk flushing mode.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: nfs-dpc-101
pool: pool001
volumeType: fs
allocType: thin
mountOptions:
- acl # Set the authentication parameter.
- cnflush # Set the asynchronous disk flushing mode.
StorageClass Parameters Supported by File Systems
Table 1 StorageClass configuration parameters
Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit. | |||||
Set this parameter to the driver name set during Huawei CSI installation. The value is the same as that of driverName in the values.yaml file. | |||||
Reclamation policy. The following types are supported: | |||||
Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded. | This function can only be used to expand PV capacity but cannot be used to reduce PV capacity. | ||||
List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host. | For details about common parameters in mountOptions, see Table 2. | ||||
Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set. | If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources. You are advised to specify a backend to ensure that the created resource is located on the expected backend. | ||||
Name of the storage resource pool where the resource to be created is located. | If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool. | ||||
Type of the volume to be created. The following types are supported: | |||||
Allocation type of the volume to be created. The following types are supported: | If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage. | ||||
IP address of the NFS client that can access the volume. This parameter is mandatory when the NFS protocol is used. You can enter the client host name (a full domain name is recommended), client IP address, or client IP address segment. | The asterisk (*) can be used to indicate any client. If you are not sure about the IP address of the access client, you are advised to use the asterisk (*) to prevent the client access from being rejected by the storage system. If the client host name is used, you are advised to use the full domain name. The IP addresses can be IPv4 addresses, IPv6 addresses, or a combination of IPv4 and IPv6 addresses. You can enter multiple host names, IP addresses, or IP address segments and separate them with semicolons (;). Example: 192.168.0.10;192.168.0.0/24;myserver1.test | ||||
The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"spaceQuota": "softQuota", "gracePeriod": 100}' | For details about the supported quota configurations, see Table 4. | ||||
QoS settings of the file system on the storage side of the PV. The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"maxMBPS": 999, "maxIOPS": 999}' | For details about the supported QoS configurations, see Table 3. | ||||
For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755. | |||||
Controls the root permission of the client. | |||||
Whether to retain the user ID (UID) and group ID (GID) of a shared directory. | |||||
Whether the snapshot directory is visible. | |||||
Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.
|
Table 2 Common parameters in mountOptions
NFS mount option on the host. The following mount option is supported: nfsvers: protocol version for NFS mounting. The value can be 3, 4, 4.0, 4.1, or 4.2. | This parameter is optional after the -o parameter when the mount command is executed on the host. The value is in list format. If the NFS version is specified for mounting, NFS 3, 4.0, 4.1, and 4.2 protocols are supported (the protocol must be supported and enabled on storage devices). If nfsvers is set to 4, the latest protocol version NFS 4 may be used for mounting due to different OS configurations, for example, 4.2. If the 4.0 protocol is required, you are advised to set nfsvers to 4.0. | |||
If the transmission protocol is rdma, set this parameter to 20049. | ||||
The DPC namespace supports the ACL function. The DPC client supports POSIX ACL, NFSv4 ACL, and NT ACL authentication. | The descriptions of acl, aclonlyposix, cnflush, and cflush are for reference only. For details about the parameters, see OceanStor Pacific Series Product Documentation and choose Configuration > Basic Service Configuration Guide for File > Configuring Basic Services (DPC Scenario) > Accessing a DPC Share on a Client > Step 2. | |||
The DPC namespace supports POSIX ACL, and the DPC client supports POSIX ACL authentication. The following protocols support POSIX ACL: DPC, NFSv3, and HDFS. If NFSv4 ACL or NT ACL is used, the DPC client cannot identify the ACL of this type. As a result, the ACL of this type does not take effect. | If aclonlyposix and acl are used together, only acl takes effect. That is, the namespace supports the ACL function. | |||
Asynchronous disk flushing mode. That is, data is not flushed to disks immediately when files in the namespace are closed. | Asynchronous flushing mode: When a file is closed, data in the cache is not flushed to storage media in synchronous mode. Instead, data is written from the cache to the storage media in asynchronous flushing mode. After the write service is complete, data is flushed from the cache to disks periodically based on the flushing period. In a multi-client scenario, if concurrent operations are performed on the same file, the file size update is affected by the disk flushing period. That is, the file size is updated only after the disk flushing is complete. Generally, the update is completed within several seconds. Synchronous I/Os are not affected by the disk flushing period. | |||
Synchronous disk flushing mode. That is, data is flushed to disks immediately when files in the namespace are closed. |
Table 3 Supported QoS configurations
Table 4 Supported quota configurations
This parameter is mandatory. Only softQuota or hardQuota can be configured. | ||
This parameter is conditionally optional only when spaceQuota is set to softQuota. |
1.3.2 - Dtree
Creating a StorageClass
Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.
Run the following command to create a StorageClass using the configuration file.
kubectl apply -f mysc.yamlRun the following command to view the information about the created StorageClass.
kubectl get sc myscThe following is an example of the command output.
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mysc csi.huawei.com Delete Immediate true 8s
Example of StorageClass Configuration Supported by the NFS Protocol
When a container uses the NFS protocol to connect to dtree resources, refer to the following StorageClass configuration example. In this example, NFS version 4.1 is specified for mounting.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: nfs-dtree-181
parentname: parent-filesystem-name
volumeType: dtree
allocType: thin
authClient: "*"
mountOptions:
- nfsvers=4.1 # Specify the version 4.1 for NFS mounting.
Example of StorageClass Configuration Supported by the DPC Protocol
When a container uses the DPC protocol to connect to dtree resources, refer to the following StorageClass configuration example. In this example, acl is used as the authentication parameter for mounting, and cnflush is used to set the asynchronous disk flushing mode.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: nfs-dtree-181
parentname: parent-filesystem-name
volumeType: dtree
allocType: thin
authClient: "*"
mountOptions:
- acl # Set the authentication parameter.
- cnflush # Set the asynchronous disk flushing mode.
StorageClass Parameters Supported by Dtrees
Table 1 StorageClass configuration parameters
Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit. | ||||
Set this parameter to the driver name set during Huawei CSI installation. The value is the same as that of driverName in the values.yaml file. | ||||
Reclamation policy. The following types are supported: | ||||
Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded. | This function can only be used to expand PV capacity but cannot be used to reduce PV capacity. | |||
List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host. | For details about common parameters in mountOptions, see Table 2. | |||
Name of the backend where the resource to be created is located. | If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources. You are advised to specify a backend to ensure that the created resource is located on the expected backend. This parameter is mandatory if parameters.parentname is set. | |||
Name of a file system on the current storage device. Dtree is created in the file system. | This parameter is mandatory when parentname is not set for the backend. If parentname is configured only in the StorageClass but not configured in the storage backend, set CSIDriverObject.attachRequired to true during CSI installation. | |||
Name of the storage resource created by dynamic volume provisioning. You can configure a placeholder to customize the storage resource name. The following placeholders are supported:
|
PVC namespace: namespace. PVC name: pvc-1. PVC UID: c2fd3f46-bf17-4a7d-b88e-2e3232bae434. volumeName is set to prefix-{{ .PVCNamespace }}_{{ .PVCName }}. The ultimate storage resource name is prefix-namespace_pvc-1-c2fd3f46bf174a7db88e2e3232bae434. | |||
Type of the volume to be created. The following types are supported: | ||||
IP address of the NFS client that can access the volume. You can enter the client host name (a full domain name is recommended), client IP address, or client IP address segment. | The asterisk (*) can be used to indicate any client. If you are not sure about the IP address of the access client, you are advised to use the asterisk (*) to prevent the client access from being rejected by the storage system. If the client host name is used, you are advised to use the full domain name. The IP addresses can be IPv4 addresses, IPv6 addresses, or a combination of IPv4 and IPv6 addresses. You can enter multiple host names, IP addresses, or IP address segments and separate them with semicolons (;). Example: 192.168.0.10;192.168.0.0/24;myserver1.test | |||
For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755. | ||||
Controls the root permission of the client. | ||||
Whether to retain the user ID (UID) and group ID (GID) of a shared directory. | ||||
Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.
|
Table 2 Common parameters in mountOptions
NFS mount option on the host. The following mount option is supported: nfsvers: protocol version for NFS mounting. The value can be 3, 4, 4.0, 4.1, or 4.2. | This parameter is optional after the -o parameter when the mount command is executed on the host. The value is in list format. If the NFS version is specified for mounting, NFS 3, 4.0, 4.1, and 4.2 protocols are supported (the protocol must be supported and enabled on storage devices). If nfsvers is set to 4, the latest protocol version NFS 4 may be used for mounting due to different OS configurations, for example, 4.2. If the 4.0 protocol is required, you are advised to set nfsvers to 4.0. | |||
If the transmission protocol is rdma, set this parameter to 20049. | ||||
The DPC namespace supports the ACL function. The DPC client supports POSIX ACL, NFSv4 ACL, and NT ACL authentication. | The descriptions of acl, aclonlyposix, cnflush, and cflush are for reference only. For details about the parameters, see OceanStor Pacific Series Product Documentation and choose Configuration > Basic Service Configuration Guide for File > Configuring Basic Services (DPC Scenario) > Accessing a DPC Share on a Client > Step 2. | |||
The DPC namespace supports POSIX ACL, and the DPC client supports POSIX ACL authentication. The following protocols support POSIX ACL: DPC, NFSv3, and HDFS. If NFSv4 ACL or NT ACL is used, the DPC client cannot identify the ACL of this type. As a result, the ACL of this type does not take effect. | If aclonlyposix and acl are used together, only acl takes effect. That is, the namespace supports the ACL function. | |||
Asynchronous disk flushing mode. That is, data is not flushed to disks immediately when files in the namespace are closed. | Asynchronous flushing mode: When a file is closed, data in the cache is not flushed to storage media in synchronous mode. Instead, data is written from the cache to the storage media in asynchronous flushing mode. After the write service is complete, data is flushed from the cache to disks periodically based on the flushing period. In a multi-client scenario, if concurrent operations are performed on the same file, the file size update is affected by the disk flushing period. That is, the file size is updated only after the disk flushing is complete. Generally, the update is completed within several seconds. Synchronous I/Os are not affected by the disk flushing period. | |||
Synchronous disk flushing mode. That is, data is flushed to disks immediately when files in the namespace are closed. |
1.3.3 - Block Services
Creating a StorageClass
Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.
Run the following command to create a StorageClass using the configuration file.
kubectl apply -f mysc.yamlRun the following command to view the information about the created StorageClass.
kubectl get sc myscThe following is an example of the command output.
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mysc csi.huawei.com Delete Immediate true 8s
Block StorageClass Configuration Example
If LUNs are used as storage resources and the file system needs to be formatted to a local file system, refer to the following example.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: lun-181
pool: StoragePool001
volumeType: lun
allocType: thin
fsType: ext4
StorageClass Parameters Supported by Block Services
Table 1 StorageClass configuration parameters
Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit. | |||||
Set this parameter to the driver name set during Huawei CSI installation. The value is the same as that of driverName in the values.yaml file. | |||||
Reclamation policy. The following types are supported: | |||||
Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded. | This function can only be used to expand PV capacity but cannot be used to reduce PV capacity. | ||||
List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host. | For details about common parameters in mountOptions, see Table 2. | ||||
Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set. | If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources. You are advised to specify a backend to ensure that the created resource is located on the expected backend. | ||||
Name of the storage resource pool where the resource to be created is located. | If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool. | ||||
Type of the volume to be created. The following types are supported: | |||||
Allocation type of the volume to be created. The following types are supported: | If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage. | ||||
Type of a host file system. The supported types are:
| This parameter is available only when volumeMode of the PVC is set to Filesystem. | ||||
LUN/NAS QoS settings of the PV on the storage side. The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"maxMBPS": 999, "maxIOPS": 999}' | For details about the supported QoS configurations, see Table 3. | ||||
For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755. | |||||
Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.
|
Table 2 Common parameters in mountOptions
Automatically triggers the Trim or Discard operation when a file system is mounted. This operation instructs a block device to release unused blocks. |
Table 3 Supported QoS configurations
1.4 - Mass Storage (OceanDisk Series)
1.4.1 - File System
Creating a StorageClass
Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.
Run the following command to create a StorageClass using the configuration file.
kubectl apply -f mysc.yamlRun the following command to view the information about the created StorageClass.
kubectl get sc myscThe following is an example of the command output.
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mysc csi.huawei.com Delete Immediate true 8s
NFS Protocol Configuration Example
When a container uses the NFS protocol to connect to file system resources, refer to the following StorageClass configuration example. In this example, NFS version 4.0 is specified for mounting.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: nfs-nas-181
pool: StoragePool001
volumeType: fs
allocType: thin
authClient: "*"
mountOptions:
- nfsvers=4.0 # Specify the version 4.0 for NFS mounting.
StorageClass Parameters Supported by File Systems
Table 1 StorageClass configuration parameters
Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit. | |||||
Set this parameter to the driver name set during Huawei CSI installation. The value is the same as that of driverName in the values.yaml file. | |||||
Reclamation policy. The following types are supported: | |||||
Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded. | This function can only be used to expand PV capacity but cannot be used to reduce PV capacity. | ||||
List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host. | For details about common parameters in mountOptions, see Table 2. | ||||
Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set. | If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources. You are advised to specify a backend to ensure that the created resource is located on the expected backend. | ||||
Name of the storage resource pool where the resource to be created is located. | If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool. | ||||
Name of the storage resource created by dynamic volume provisioning. You can configure a placeholder to customize the storage resource name. The following placeholders are supported:
|
PVC namespace: namespace. PVC name: pvc-1. PVC UID: c2fd3f46-bf17-4a7d-b88e-2e3232bae434. volumeName is set to prefix-{{ .PVCNamespace }}_{{ .PVCName }}. The ultimate storage resource name is prefix-namespace_pvc-1-c2fd3f46bf174a7db88e2e3232bae434. | ||||
Type of the volume to be created. The following types are supported: | |||||
Allocation type of the volume to be created. The following types are supported: | If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage. | ||||
IP address of the NFS client that can access the volume. You can enter the client host name (a full domain name is recommended), client IP address, or client IP address segment. | The asterisk (*) can be used to indicate any client. If you are not sure about the IP address of the access client, you are advised to use the asterisk (*) to prevent the client access from being rejected by the storage system. If the client host name is used, you are advised to use the full domain name. The IP addresses can be IPv4 addresses, IPv6 addresses, or a combination of IPv4 and IPv6 addresses. You can enter multiple host names, IP addresses, or IP address segments and separate them with semicolons (;). Example: 192.168.0.10;192.168.0.0/24;myserver1.test | ||||
4 indicates the highest speed. This parameter takes effect when a PV is cloned or a PV is created using a snapshot. | |||||
Log in to DeviceManager and choose Services > File Service > File Systems > Create to obtain the application type name. | |||||
QoS settings of the file system on the storage side of the PV. The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"maxMBPS": 999, "maxIOPS": 999}' | For details about the supported QoS configurations, see Table 3. | ||||
For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755. | |||||
Controls the root permission of the client. | |||||
Whether to retain the user ID (UID) and group ID (GID) of a shared directory. | |||||
Configures the krb5 security protocol. | During mounting, you can specify the sec parameter in mountOptions. | ||||
Configures the krb5i security protocol. | During mounting, you can specify the sec parameter in mountOptions. | ||||
Configures the krb5p security protocol. | During mounting, you can specify the sec parameter in mountOptions. | ||||
Whether the snapshot directory is visible. | |||||
Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.
| |||||
Advanced volume creation parameters. The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"CAPACITYTHRESHOLD": 90}' | For details about the supported advanced parameters, see Table 4. |
Table 2 Common parameters in mountOptions
Table 3 Supported QoS configurations
Table 4 Supported advanced volume creation parameters
For details about the default value and value range, see the corresponding storage product manual. |
1.4.2 - Block Services
Creating a StorageClass
Prepare a StorageClass configuration file, for example, msc .yaml. For details about the StorageClass configuration, see the following example.
Run the following command to create a StorageClass using the configuration file.
kubectl apply -f mysc.yamlRun the following command to view the information about the created StorageClass.
kubectl get sc myscThe following is an example of the command output.
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mysc csi.huawei.com Delete Immediate true 8s
Block StorageClass Configuration Example
If LUNs are used as storage resources and the file system needs to be formatted to a local file system, refer to the following example.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: mysc
provisioner: csi.huawei.com
parameters:
backend: lun-181
pool: StoragePool001
volumeType: lun
allocType: thin
fsType: ext4
StorageClass Parameters Supported by Block Services
Table 1 StorageClass configuration parameters
Take Kubernetes v1.22.1 as an example. The value can contain digits, lowercase letters, hyphens (-), and periods (.), and must start and end with a letter or digit. | |||||
Set this parameter to the driver name set during Huawei CSI installation. The value is the same as that of driverName in the values.yaml file. | |||||
Reclamation policy. The following types are supported: | |||||
Whether to allow volume expansion. If this parameter is set to true, the capacity of the PV that uses the StorageClass can be expanded. | This function can only be used to expand PV capacity but cannot be used to reduce PV capacity. | ||||
List of mount parameters, which can be used to specify the parameters of the -o option when the mount command is executed on a host. | For details about common parameters in mountOptions, see Table 2. | ||||
Name of the backend where the resource to be created is located. This field must be set if parameters.pool is set. | If this parameter is not set, Huawei CSI will randomly select a backend that meets the capacity requirements to create resources. You are advised to specify a backend to ensure that the created resource is located on the expected backend. | ||||
Name of the storage resource pool where the resource to be created is located. | If this parameter is not set, Huawei CSI will randomly select a storage pool that meets the capacity requirements from the selected backend to create resources. You are advised to specify a storage pool to ensure that the created resource is located in the expected storage pool. | ||||
Type of the volume to be created. The following types are supported: | |||||
Allocation type of the volume to be created. The following types are supported: | If this parameter is set to thin, the required space is not allocated immediately when a volume is created. Instead, the space is dynamically allocated based on the usage. | ||||
Type of a host file system. The supported types are:
| This parameter is available only when volumeMode of the PVC is set to Filesystem. | ||||
4 indicates the highest speed. This parameter takes effect when you clone a PVC or create a PVC from a snapshot. | |||||
Log in to DeviceManager and choose Services > Block Service > LUN Groups (or Namespace Groups) > LUNs (or Namespaces) > Create to obtain the application type name. | |||||
LUN/NAS QoS settings of the PV on the storage side. The value of the parameter is JSON character strings in dictionary format. A character string is enclosed by single quotation marks and the dictionary key by double quotation marks. Example: '{"maxMBPS": 999, "maxIOPS": 999}' | For details about the supported QoS configurations, see Table 3. | ||||
For details about the configuration format, refer to the Linux permission settings, for example, 777 and 755. | |||||
Whether to disable volume capacity verification. After this function is disabled, the system will not verify whether the volume capacity is an integer multiple of the sector size.
| |||||
Table 2 Common parameters in mountOptions
Automatically triggers the Trim or Discard operation when a file system is mounted. This operation instructs a block device to release unused blocks. |
Table 3 Supported QoS configurations
The value is an integer ranging from 1 to 999999999, expressed in MB/s. | ||
The value is an integer ranging from 1 to 999999999, expressed in MB/s. | ||
2 - Managing a StorageClass
2.1 - Querying a StorageClass
Run the following command to view the information about the created StorageClass.
kubectl get sc myscThe following is an example of the command output.
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mysc csi.huawei.com Delete Immediate true 8s
2.2 - Modifying a StorageClass
Kubernetes allows only the allowVolumeExpansion field of a StorageClass to be modified. The modification method is as follows:
Run the following command to check whether the StorageClass can be expanded:
kubectl get sc myscIf the command output is displayed as the following example, the StorageClass mysc cannot be expanded:
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mysc csi.huawei.com Delete Immediate false 8sRun the following command to enable capacity expansion for the StorageClass:
kubectl patch sc mysc --patch '{"allowVolumeExpansion":true}'Check the StorageClass again and ensure that the modification is successful.
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mysc csi.huawei.com Delete Immediate true 8s
2.3 - Deleting a StorageClass
Run the following command to view the StorageClass:
kubectl get sc myscThe following is an example of the command output.
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mysc csi.huawei.com Delete Immediate false 8sRun the following command to delete the StorageClass:
kubectl delete sc myscIf the following information is displayed, the deletion is successful:
storageclass.storage.k8s.io "mysc" deleted