Create a StorageClass
This topic describes how to create a StorageClass.
AKS supports the following two types of storage classes:
In the current Agile Platform as a Service (PaaS) environment, AKS is not integrated with Alibaba Cloud NAS or cloud disk storage. To use storage features, you must install a third-party storage plugin.
NAS type
A NAS StorageClass must be in the same region as the AKS cluster nodes.
The following shows the definition of a NAS StorageClass in AKS:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: csi-nas
provisioner: antcloud-csi
parameters:
# region is not required
storage_type: "cloud_nas" # Allowed enum: cloud_disk, cloud_nas, cloud_oss
# filesystem parameters
nasType: "Capacity" # Allowed enum: Capacity, Performance, Extreme *
protocolType: "NFS" # Allowed enum: NFS, SMB *
fileSystemDescription: "balala" # Optional
# mountTarget parameters
# accessGroupName: "classic-test" # The name of the default access group. This parameter has been removed.
# networkType: Vpc # Allowed enum: Vpc, Classic. Only Vpc is currently supported. RMC performs a database query.
# vSwitchId: "vsw-2zevmwkwyztjuoffgdiwl" # vSwitch ID, used in a VPC network *
# vpcId: "vpc-2zesj9afh3y518k9oe86q" # VPC ID, used in a VPC network *
# accessGroup parameters. The current solution uses the default access group, so these parameters are not required.
serviceId: "1c7aff75-8b4f-4d2c-8dac-74af0b830d86-aliyun-nas-service-id"
planId: "44dd37f1-77f9-42c5-91a5-743c007ba484-aliyun-nas-plan-id"
accessModes: "ReadWriteMany" # *
reclaimPolicy: Retain # Allowed enum: Delete, Retain
volumeBindingMode: Immediate # Allowed enum: Immediate, WaitForFirstConsumerParameter descriptions
Parameter name | Description | Required | Notes |
provisioner | antcloud-csi | Yes | The name of the AKS dynamic volume controller. This parameter cannot be changed. |
storage_type | The backend storage type, such as block storage or file storage. | Yes | Only the following values are supported:
|
nasType | The NAS type. | Yes | Valid values:
|
protocolType | The file system type. | No | Only NFS is supported. |
readOnly | Read-only | No | Valid values: true, false |
serviceId | A required parameter for the service broker. | Yes | Must be: 1c7aff75-8b4f-4d2c-8dac-74af0b830d86-aliyun-nas-service-id |
planId | A required parameter for the service broker. | No | Must be: 44dd37f1-77f9-42c5-91a5-743c007ba484-aliyun-nas-plan-id |
reclaimPolicy | The reclaim policy. | Yes |
|
volumeBindingMode | The volume binding policy. | Yes | Controls volume binding and dynamic provisioning behavior.
|
Cloud disk (cloud_disk) type
A cloud disk StorageClass must be in the same region and zone as the AKS cluster nodes.
The following shows the definition of a cloud disk StorageClass in AKS:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: csi-disk-ssd
provisioner: antcloud-csi
parameters:
fsType: "ext4"
storage_type: "cloud_disk" # Allowed enum: cloud_disk, cloud_nas, cloud_oss
type: "cloud_ssd"
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: WaitForFirstConsumer # Allowed enum: Immediate, WaitForFirstConsumerParameter descriptions
Parameter name | Description | Required | Notes |
provisioner | antcloud-csi | Yes | The name of the dynamic volume controller. This parameter cannot be changed. |
failure-domain.beta.kubernetes.io/region | The region. | No | This field is required when volumeBindingMode is set to |
failure-domain.beta.kubernetes.io/zone | The zone. | No | This field is required when volumeBindingMode is set to |
fsType | The partition format. | No | Supports ext4 and ext3. The default is ext4. |
storage_type | The backend storage type. | Yes |
|
type | The disk type. | Yes | Valid values: cloud_ssd, cloud_efficiency, and cloud. For more information, see Cloud disk overview. |
readOnly | Specifies whether the volume is read-only. | No | Valid values: true, false. |
serviceId | A required parameter for the service broker. | Yes | Must be: |
planId | A required parameter for the service broker. | No | Must be: |
reclaimPolicy | The reclaim policy. | Yes |
|
volumeBindingMode | The volume binding policy. | Yes | Controls volume binding and dynamic provisioning behavior.
|
Prerequisites
You must have administrative permissions for AKS.
Procedure
Log on to the containerized application service console. In the navigation pane on the left, click Storage > StorageClass.
On the StorageClass page, click Create StorageClass. Enter the YAML content in the input box and click Submit.