Home > Storage > PowerStore > Virtualization and Cloud > Dell PowerStore: VMware vSphere with Tanzu and TKG Clusters > Persistent volumes
A persistent volume is a storage resource that is requested by DevOps team through a persistent volume claim. A persistent volume is used to maintain stateful data for containerized applications. This section will demonstrate the process of provisioning and deleting a dynamic persistent volume backed by PowerStore storage.
To provision a dynamic persistent volume, follow these steps:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pvc
spec:
storageClassName: vk8s-vvol-silver
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
C:\>kubectl apply -f C:\Users\jboche\Downloads\my-pvc.yaml
persistentvolumeclaim/my-pvc created
Once the persistent volume claim has been applied, it will be visible in the vSphere UI along with storage capacity it consumes.
The kubectl get pvc command should return the new persistent volume claim of 5Gi using vVol storage and a status of bound.
C:\>kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
my-pvc Bound pvc-972f2d9a-8887-4645-8a64-ce9151360c4a 5Gi RWO vk8s-vvol-silver 67s
Note: If the new persistent volume claim is not shown or is not bound, check the vCenter Server for errors.
The kubectl describe namespace command will reflect the persistent volume claim of 5Gi along with the storage limits imposed in the previous section.
C:\>kubectl describe namespace devops
Name: devops
Labels: vSphereClusterID=domain-c8
Annotations: ls_id-0: cea4a565-dfc7-4ee2-a79c-137f9723a86c
ncp/extpoolid: domain-c8:c2fdf804-b0a0-4bcb-99be-9dab04afa64f-ippool-100-88-145-225-100-88-145-254
ncp/router_id: t1_556a87e1-2308-4992-8418-1445bd1b4dd5_rtr
ncp/snat_ip: xxx.xxx.xxx.227
ncp/subnet-0: 10.244.0.32/28
vmware-system-resource-pool: resgroup-3033
vmware-system-resource-pool-cpu-limit:
vmware-system-resource-pool-memory-limit:
vmware-system-vm-folder: group-v3034
Status: Active
Resource Quotas
Name: devops
Resource Used Hard
-------- --- ---
requests.storage 5Gi 50Gi
Name: devops-storagequota
Resource Used Hard
-------- --- ---
vk8s-vvol-silver.storageclass.storage.k8s.io/requests.storage 5Gi 10Gi
No LimitRange resource.
Once a persistent volume is no longer in use by the vSphere Pods in the vSphere Namespace, its corresponding persistent volume claim can be removed.
To delete a dynamic persistent volume claim, follow these steps:
C:\>kubectl delete -f C:\Users\jboche\Downloads\my-pvc.yaml
persistentvolumeclaim "my-pvc" deleted
Once the persistent volume claim has been deleted, it should disappear from the vSphere UI and replenish the storage capacity it was once using.
Although the persistent volume claim has been deleted and confirmed in the vSphere UI, the first class disk containing stateful data on physical storage remains. The first class disk will be visible in the vSphere UI when examining datastore files and PowerStore Manager if the backing storage was vVols. Assuming the stateful data contained in the first class disk is no longer needed, the last step in the cleanup process is to manually delete the first class disk using the datastore browser in the vSphere UI. If vVols were used for persistent storage, the first class disks can also be removed using PowerStore Manager.