Create a Storage Class
This section describes how to create a storage class.
Prerequisites
-
You need to join a cluster and have the Storage Class Management permission in the cluster. For more information, see Cluster Members and Cluster Roles.
-
To enable the storage class to provide storage resources normally, you need to configure the storage system in advance and install the corresponding storage plugin for the storage system. For more related information, please contact your storage system provider.
Steps
-
Log in to the KubeSphere web console with a user who has Storage Class Management permissions and enter your cluster.
-
Click Storage > Storage Classes in the left navigation pane.
-
Click Create on the page.
-
On the Basic Information tab, configure the basic information for the storage class, then click Next.
Parameter Description Name
The name of the storage class. The name can only contain lowercase letters, numbers, and hyphens (-), must start and end with a lowercase letter or number, and is up to 63 characters long.
Alias
The alias of the storage class. Different storage classes can have the same alias.
Storage Type
Block storage, object storage, or file storage.
Description
The description of the storage class. The description can contain any characters and is up to 256 characters long.
-
On the Storage System tab, select a system or Custom, then click Next.
-
On the Storage Class Settings tab, configure the parameters for the storage class, then click Create.
Parameter Description Volume Expansion
Whether to allow users to expand the storage capacity of persistent volume claims in the KubeSphere web console.
Reclaim Policy
Reclaim policy of the persistent volume. The KubeSphere platform uses the Delete reclaim policy by default, which means the persistent volume is deleted when the persistent volume claim is deleted. For more information, refer to the Kubernetes official documentation.
Access Mode
The read/write mode allowed for the volume.
-
ReadWriteOnce: Allows a single node to read data from the volume and write data to the volume.
-
ReadOnlyMany: Allows multiple nodes to read data from the volume.
-
ReadWriteMany: Allows multiple nodes to read data from the volume and write data to the volume.
You can select one or more access modes from the drop-down list. Some storage systems may not support certain access modes.
Provisioner
The storage plugin used by the storage class.
Volume Binding Mode
Whether to create a persistent volume and bind it to the persistent volume claim immediately after the claim is created. The following modes are supported:
-
Immediate Binding: Creates a persistent volume and binds it to the persistent volume claim immediately after the claim is created.
-
WaitForFirstConsumer Binding: Creates a persistent volume and binds it to the persistent volume claim after the pod that mounts the persistent volume is created.
Parameters
Key-value pairs that match the backend storage system and storage plugin.
-
Click Add to configure multiple parameters.
-
Click
on the right side of a created parameter to delete it.
For more related information, please contact your storage system provider.
After the storage class is created, it will appear in the storage class list.
-