Stateful applications, for example databases, save data between sessions and require persistent storage to store the data. The retained data is called the application's state. You can later retrieve the data and use it in the next session. Kubernetes offers persistent volumes as objects capable of retaining their state and data.
In the vSphere environment, the persistent volume objects are backed by virtual disks that reside on datastores. Datastores are represented by storage policies. After the vSphere administrator creates a storage policy, for example gold, and assigns it to a namespace in a Supervisor Cluster, the storage policy appears as a matching Kubernetes storage class in the vSphere Namespace and any available Tanzu Kubernetes clusters.
As a DevOps engineer, you can use the storage class in your persistent volume claim specifications. You can then deploy an application that uses storage from the persistent volume claim. In this example, the persistent volume for the application is created dynamically.
Prerequisites
Make sure that your vSphere administrator has created an appropriate storage policy and assigned the policy to the namespace.
Procedure
Results
The pod that you configured uses persistent storage described in the persistent volume claim.
What to do next
To monitor health status of the persistent volume, see Monitor Volume Health in a vSphere Namespace or Tanzu Kubernetes Cluster. To review and monitor the persistent volume in the vSphere Client, see Monitor Persistent Volumes in the vSphere Client.