Creating a PV
Manually create a static persistent volume of type HostPath or NFS Shared Storage.
-
HostPath: Mounts the file directory from the host where the container resides to a specified path in the container (corresponding to Kubernetes' HostPath), allowing the container to use the host's file system for persistent storage. If the host becomes inaccessible, the HostPath may not be accessible.
-
NFS Shared Storage: NFS Shared Storage uses the community NFS CSI (Container Storage Interface) storage plugin, which aligns more closely with Kubernetes design principles, providing client access capabilities for multiple services. Ensure that the current cluster has deployed the NFS storage plugin before use.
TOC
Prerequisites
-
Confirm the size of the persistent volume to be created and ensure that the backend storage system currently has the capacity to provide the corresponding storage.
-
Obtain the backend storage access address, the file path to be mounted, credential access (if required), and other relevant information.
Example PersistentVolume
- Amount of storage.
- How the volume can be mounted.
- What happens after PVC is deleted (Retain, Delete, Recycle).
- Name of the StorageClass (for dynamic binding).
- Storage backend type.
Creating PV by using the web console
-
Navigate to Administrator.
-
In the left navigation bar, click on Storage Management > Persistent Volumes (PV).
-
Click on Create Persistent Volume.
-
Refer to the instructions below and configure the parameters before clicking Create.
Storage Information
Creating PV by using the CLI
Access Modes
Access modes of the persistent volume influenced by the relevant parameters set by the backend storage.
Reclaim Policies
Related Operations
You can click the ⋮ on the right of the list page or click the Operations in the upper right corner of the details page to update or delete the persistent volume as needed.
Deleting a persistent volume is applicable in the following two scenarios:
-
Deleting an unbound persistent volume: Has not been written to and is no longer required for writing, thus freeing up corresponding storage space upon deletion.
-
Deleting a Retained persistent volume: The persistent volume claim has been deleted, but due to the retain reclaim policy, it has not been deleted simultaneously. If the data in the persistent volume has been backed up to other storage or is no longer needed, deleting it can also free up corresponding storage space.