This section describes how to create a persistent volume using a volume snapshot.

After a volume snapshot is created, you can use it to create a persistent volume claim and a persistent volume.

Prerequisites

  • The KubeSphere Storage extension must be installed and enabled on the KubeSphere platform.

  • You need to join a cluster or project and have the Volume Snapshot Management permission in the cluster or project. For more information, please refer to Cluster Roles and Project Roles.

Steps

  1. Log in to the KubeSphere web console as a user with the Volume Snapshot Management permission and enter your cluster or workspace.

  2. Click Storage > Volume Snapshots in the left navigation pane.

  3. In the volume snapshot list, click the name of a volume snapshot to open its details page.

  4. On the Volume Snapshot details page, click Operation > Create Volume.

  5. On the Basic Information tab, set the basic information for the PersistentVolumeClaim, then click Next.

    Parameter Description

    Name

    The name of the PersistentVolumeClaim. The name can only contain lowercase letters, numbers, and hyphens (-), must start and end with a lowercase letter or number, and can be up to 253 characters long.

    Alias

    The alias of the PersistentVolumeClaim. Different PersistentVolumeClaims can have the same alias.

    Description

    The description of the PersistentVolumeClaim. The description can contain any characters and can be up to 256 characters long.

  6. On the Storage Settings tab, select the access mode for the backend storage area, then click Next.

    Parameter Description

    ReadWriteOnce

    Allows a single node to read data from and write data to the backend storage area.

    ReadOnlyMany

    Allows multiple nodes to read data from the backend storage area.

    ReadWriteMany

    Allows multiple nodes to read data from and write data to the backend storage area.

  7. On the Advanced Settings tab, set the labels and annotations for the PersistentVolumeClaim, then click Create.

    • Click Add to set multiple labels or annotations.

    • Click trash-light on the right side of a created label or annotation to delete it.

    The system will create the PersistentVolumeClaim based on the parameters set in the above steps, and will also create the corresponding PersistentVolume based on the snapshot data.