vSphere with Tanzu uses storage policies to integrate with shared datastores available in your environment, including VMFS, NFS, vSAN, or vVols datastores. The policies represent datastores and manage the storage placement of such objects as control plane VMs, pod ephemeral disks, container images, and persistent storage volumes. If you use Tanzu Kubernetes clusters, the storage policies also dictate how the Tanzu Kubernetes cluster nodes are deployed.
Before you enable vSphere with Tanzu, create storage policies to be used by the Supervisor Cluster and namespaces.
Depending on your vSphere storage environment and the needs of DevOps, you can create several storage policies to represent different classes of storage.
For example, if a vSphere Pod mounts all three types of virtual disks and your vSphere storage environment has three classes of datastores, Bronze, Silver, and Gold, you can create storage policies for all datastores. You can then use the Bronze datastore for ephemeral and container image virtual disks, and use the Silver and Gold datastores for persistent volume virtual disks.
For general information about storage policies, see the Storage Policy Based Management chapter in the vSphere Storage documentation. For information about creating storage policies, see Create Storage Policies for vSphere with Tanzu.
Ephemeral Virtual Disks
A vSphere Pod and a pod that runs in a Tanzu Kubernetes cluster requires ephemeral storage to store such Kubernetes objects as logs, emptyDir volumes, and ConfigMaps during its operations. This ephemeral, or transient, storage lasts as long as the pod continues to exist. Ephemeral data persists across container restarts, but once the pod reaches the end of its life, the ephemeral virtual disk disappears.
Each pod has one ephemeral virtual disk. A vSphere administrator uses a storage policy to define the datastore location for all ephemeral virtual disks when configuring storage for the Supervisor Cluster.
Container Image Virtual Disks
Containers inside the pod use images that contain the software to be run. The pod mounts images used by its containers as image virtual disks. When the pod completes its life cycle, the image virtual disks are detached from the pod.
Image Service, an ESXi component, is responsible for pulling container images from the image registry and transforming them into virtual disks to run inside the pod.
ESXi can cache images that are downloaded for the containers running in the pod. Subsequent pods that use the same image pull it from the local cache rather than the external container registry.
As with ephemeral disks, the vSphere administrator specifies the datastore location for the image cache at the Supervisor Cluster level. See Configuring and Managing a Supervisor Cluster and Change Storage Settings on the Supervisor Cluster.
For information about working with the container images, see Using a Container Registry for vSphere with Tanzu Workloads.
Persistent Storage Virtual Disks
Certain Kubernetes workloads require persistent storage to store data permanently. To provision persistent storage for Kubernetes workloads, vSphere with Tanzu integrates with Cloud Native Storage (CNS), a vCenter Server component that manages persistent volumes.
Persistent storage can be used by vSphere Pods, Tanzu Kubernetes clusters, and VMs. To make persistent storage available to the DevOps team, the vSphere administrators create VM storage policies that describe different storage requirements and classes of services. They can then assign the storage policies to a vSphere Namespace. See Create and Configure a vSphere Namespace and Change Storage Settings on a Namespace.
For more information and for specifics on how persistent storage is used by the Supervisor Cluster and the Tanzu Kubernetes clusters, see Using Persistent Storage in vSphere with Tanzu and Provisioning and Operating TKGS Clusters.