You can manage storage classes with ease in the LDC Hybrid Cloud (LHC) console, for example, creating and deleting storage classes.
LHC now supports the following types of storage classes:
At present, LDC Hybrid Cloud (LHC) is not connected to Alibaba Cloud NAS or cloud disk storage. To use the storage feature, you must install third-party storage plug-ins.
NAS storage class
The NAS storage class must be in the same region as that of the LHC cluster.
The following sample code shows how an NAS storage class is defined in LHC:
apiVersion: storage.k8s.io/v1
kind:StorageClass
metadata:
name: csi-nas-capacity
provisioner: antcloud-csi
parameters:
storage_type:"cloud_nas"# Allowed enum: cloud_disk, cloud_nas
# filesystem parameters
nasType:"Capacity"# Allowed enum: Capacity, Performance, Extreme *
protocolType:"NFS"# Allowed enum: NFS, SMB *
serviceId:"1c7aff75-8b4f-4d2c-8dac-74af0b830d86-aliyun-nas-service-id"
planId:"44dd37f1-77f9-42c5-91a5-743c007ba484-aliyun-nas-plan-id"
reclaimPolicy:Retain# Allowed enum: Delete, Retain
volumeBindingMode:Immediate# Allowed enum: Immediate, WaitForFirstConsumerParameter description
Parameter | Description | Required | Remarks |
provisioner | antcloud-csi | Yes | The name of the LHC dynamic volume controller. It cannot be changed. |
storage_type | The backup storage type, including block storage and file storage. | Yes | Available options:
|
nasType | The NAS type. | Yes | Valid values:
|
protocolType | The file system type. | No | At present, only NFS is supported. |
readOnly | Specifies whether the storage is read-only. | No | Valid values: true and false |
serviceId | The ID of the service. This parameter is required for the service broker. | Yes | The value must be 1c7aff75-8b4f-4d2c-8dac-74af0b830d86-aliyun-nas-service-id. |
planId | A parameter required by the service broker. | No | The value must be 44dd37f1-77f9-42c5-91a5-743c007ba484-aliyun-nas-plan-id. |
reclaimPolicy | The reclaim policy. | Yes |
|
volumeBindingMode | The volume binding policy. | Yes | Controls the volume binding and dynamic provisioning operations.
|
Cloud disk storage class
The cloud disk storage class must be located in the same region and availability zone (AZ) as those of the LHC cluster node.
The following sample code shows how a cloud disk storage class is defined in LHC:
apiVersion: storage.k8s.io/v1
kind:StorageClass
metadata:
name: csi-disk-efficiency
provisioner: antcloud-csi
parameters:
failure-domain.beta.kubernetes.io/zone:<Must match the AZ of nodes in the current cluster.>
failure-domain.beta.kubernetes.io/region:<Must match the region of the current cluster.>
fsType:"ext4"
storage_type:"cloud_disk"# Allowed enum: cloud_disk, cloud_nas
type:"cloud_ssd"
readOnly:"false"
serviceId:"8814fddf-5be7-4f8a-862c-f4a57c25a0b4-aliyun-disk-service-id"
planId:"02b41c80-915f-43cd-a574-e9cd446f13ea-aliyun-disk-plan-id"
reclaimPolicy:Retain# Allowed enum: Delete, Retain
volumeBindingMode:Immediate# Allowed enum: Immediate, WaitForFirstConsumerParameter description
Parameter | Description | Required | Remarks |
provisioner | antcloud-csi | Yes | The name of the dynamic volume controller. It cannot be changed. |
failure-domain.beta.kubernetes.io/region | The region. | No | When volumeBindingMode is set to Immediate, this parameter is required and is used for creating cloud disks. For example, CN-SHANGHAI represents the Shanghai region. |
failure-domain.beta.kubernetes.io/zone | The AZ. | No | When volumeBindingMode is set to Immediate, this parameter is required and is used for creating cloud disks. For example, CN-SHANGHAI-A represents AZ A in the Shanghai region. |
fsType | The partition format. | No | ext4 and ext3 are supported. The default value is ext4. |
storage_type | The backup storage type. | Yes |
|
type | The disk type. | Yes | Valid values: cloud_ssd, cloud_efficiency, and cloud. |
readOnly | Specifies whether the storage is read-only. | No | Valid values: true and false |
serviceId | The ID of the service. This parameter is required for the service broker. | Yes | The value must be |
planId | The ID of the service. This parameter is required for the service broker. | No | The value must be |
reclaimPolicy | The reclaim policy. | Yes |
|
volumeBindingMode | The volume binding policy. | Yes | Controls the volume binding and dynamic provisioning operations.
|
Create a storage class
Log on to the LHC console and choose Manage Clusters > Cluster Details in the left-side navigation pane to go to the Clusters page.
Click the name of the target cluster to go to the Cluster Details page and click the Storage tab.
In the left-side menu, click Storage Class, and then click Create Storage Class.
In the input box that appears, enter the YAML content, and then click Submit.
For more information, see NAS storage class.
Update a storage class
Log on to the LHC console and choose Manage Clusters > Cluster Details in the left-side navigation pane to go to the Clusters page.
Click the name of the target cluster to go to the Cluster Details page and click the Storage tab.
In the left-side menu, click Storage Class, and then click View/Edit in the Actions column of the target storage class.
Modify the information in the YAML edit box, and then click Submit.
After the YAML file is updated, the system automatically updates the storage class based on the updated YAML file.
Delete a storage class
Log on to the LHC console and choose Manage Clusters > Cluster Details in the left-side navigation pane to go to the Clusters page.
Click the name of the target cluster to go to the Cluster Details page and click the Storage tab.
In the left-side menu, click Storage Class.
In the Actions column of the target storage class, choose More > Delete.
In the dialog box that appears, click OK.