Persistent volumes are typically used for stateful applications. vSphere with Tanzu supports dynamic and static provisioning of persistent volumes.
- Dynamic Provisioning
With dynamic volume provisioning, storage does not need to be pre-provisioned and persistent volumes can be created on demand. DevOps engineers issue a persistent volume claim that references a storage class available in the namespace.
vSphere with Tanzu automatically provisions the corresponding persistent volume and a backing virtual disk.
Both the Supervisor Cluster and Tanzu Kubernetes cluster support dynamic provisioning.
For an example of how to dynamically create a persistent volume for a stateful application, see Provision a Dynamic Persistent Volume for a Stateful Application.
- Static Provisioning
With static provisioning, you can use an existing storage object and make it available to a cluster.
To provision a static persistent volume, you manually create a virtual disk to use as a backing storage for the persistent volume. You then create a persistent volume that contains details of the backing storage. When a persistent volume claim is issued, Kubernetes selects an available persistent volume in the system and allocates it to the workload.
Only Tanzu Kubernetes clusters support static provisioning.
For an example of how to provision a static persistent volume, see Provision a Static Persistent Volume for a Stateful Application.
For more information about persistent volumes in Kubernetes, refer to the Kubernetes documentation.
For information on the interaction between vSphere storage and persistent volumes, see Storage in vSphere with Tanzu.