Dynamic and static provisioning
The section provides some examples of dynamic and static provisioning. For more examples, see https://github.com/weka/csi-wekafs/tree/main/examples.
Dynamic provisioning
Dynamic provisioning means defining a persistent volume claim (PVC) for the pods using a storage class similar to the storage class described in the Storage class configuration section.
Procedure
Create a PVC yaml file (see the following example).
Apply the PVC yaml file and validate it is created successfully.
Persistent volume claim parameters
spec.accessModes
The volume access mode.
Possible values: ReadWriteMany
, ReadWriteOnce
, ReadOnlyMany
spec.storageClassName
The storage class to use to create the PVC. The storage class must exist.
spec.resources.requests.storage
The required capacity for the volume. The capacity quota is not enforced but is stored on the filesystem directory extended and attributed for future use.
The directory is created in the filesystem under the csi-volumes
directory starting with the volume name.
Static provisioning
The Kubernetes admin can prepare persistent volumes in advance to be used by pods. The persistent volume must be an existing directory, and can contain pre-populated data used by the PODs.
The persistent volume can be a directory previously provisioned by the CSI or a an existing directory in the WEKA filesystem.
To expose an existing directory in the WEKA filesystem through the CSI, define a persistent volume, and bind the persistent volume claim to this persistent volume.
You can use an existing storage class from dynamic provisioning for static provisioning. However, the Persistent Volume parameters (filesystemName
, filesystemGroupName
, and volumeType
) will override those in the storage class.
Procedure
Create a PV yaml file (see the following example).
Apply the PV yaml file and validate it is created successfully.
Persistent volume parameters
spec.accessModes
Defines the access mode for the volume. Possible values include:
ReadWriteMany
, ReadWriteOnce
, ReadOnlyMany
spec.storageClassName
Storage class for PV creation. Specifies the storage class to be used when creating the Persistent Volume (PV). The storage class must already exist.
spec.capacity.storage
Required capacity for the volume. The specified capacity is not enforced but is recorded as a quota within the filesystem directory's extended attributes for future reference.
spec.csi.volumeHandle
Specifies the path previously created within the WEKA cluster. This string includes the volume type, filesystem name, and directory path. The filesystem and path must exist within the cluster.
Examples:
Static directory:
dir/v1/podsFilesystem/my-dir
Static filesystem:
weka/v2/podsFilesystem/my-fs
Static snapshot:
weka/v2/podsFilesystem/my-snap
Bind a PVC to this specific PV using the
volumeName
parameter under the PVCspec
and provide it with the specific PV name.
Persistent volume claim for static provisioning
spec.accessModes
The volume access mode.
Possible values: ReadWriteMany
, ReadWriteOnce
, ReadOnlyMany
spec.storageClassName
The storage class to use to create the PVC.
It must be the same storage class as the PV requested to bind in spec.volumeName
.
spec.resources.requests.storage
The required capacity for the volume. The capacity quota is not enforced but is stored on the filesystem directory extended and attributed for future use.
spec.volumeName
The name of a pre-configured persistent volume. The persistent volume name must exist.
Validate that the PVC resource is created and successfully bounded (the status is
Bound
).
Last updated