vSphere Container Storage Plug-in supports static provisioning for block volumes in native Kubernetes clusters.
Static provisioning is a feature native to Kubernetes. With static provisioning, cluster administrators can make existing storage devices available to a cluster. If you have an existing persistent storage device in your vCenter Server, you can use static provisioning to make the storage instance available to your cluster.
As a cluster administrator, you must know the details of the storage device, its supported configurations, and mount options.
To make existing storage available to a cluster user, you must manually create the storage device, a
PeristentVolume
, and a
PersistentVolumeClaim
. Because the PV and the storage device already exist, you do not need to specify a storage class name in the PVC specification. You can use different ways to create a static PV and PVC binding. For example, label matching, volume size matching, and so on.
Note: Creating multiple PVs for the same volume backed by a vSphere virtual disk (First Class Disk) in the Kubernetes cluster is not supported.
The common use cases of static volume provisioning include the following.
- Use an existing storage device
-
You have provisioned a persistent storage, First Class Disk (FCD), directly in your
vCenter Server, and want to use this
FCD
in your cluster. - Make retained data available to the cluster
-
You have provisioned a volume with a
reclaimPolicy:retain
parameter in the storage class by using dynamic provisioning. You have removed thePVC
, but thePV
, the physical storage in vCenter Server, and the data still exists. You want to access the retained data from an application in your cluster. - Share persistent storage across namespaces in the same cluster
-
You have provisioned a
PV
in a namespace of your cluster. You want to use the same storage instance for an application pod that is deployed to a different namespace in your cluster. - Share persistent storage across clusters in the same zone
-
You have provisioned a
PV
for your cluster. To share the same persistent storage instance with other clusters in the same zone, you must manually create thePV
and matchingPVC
in the other cluster.
Note: Sharing persistent storage across clusters is available only if the cluster and the storage instance are located in the same zone.
- Statically provision a Single Access (RWO) Volume backed by vSphere Virtual Disk (First Class Disk)
-
This procedure provides instructions to provision a persistent volume statically on a
Vanilla Kubernetes
cluster. Make sure to mentionpv.kubernetes.io/provisioned-by: csi.vsphere.vmware.com
in the PV annotation.
Note: Do not specify the key
storage.kubernetes.io/csiProvisionerIdentity
in
csi.volumeAttributes
in PV specification. This key indicates dynamically provisioned PVs.