Dynamic and static provisioning
Last updated
Last updated
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 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.
Parameter | Description |
---|---|
The directory is created in the filesystem under the csi-volumes
directory starting with the volume name.
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.
Bind a PVC to this specific PV using the volumeName
parameter under the PVC spec
and provide it with the specific PV name.
Validate that the PVC resource is created and successfully bounded (the status is Bound
).
Parameter | Description |
---|---|
Parameter | Description |
---|---|
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.
spec.accessModes
The volume access mode.
Possible values: ReadWriteMany
, ReadWriteOnce
, ReadOnlyMany
spec.storageClassName
The storage class to use to create the PV. The storage class must exist.
spec.capacity.storage
A 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.csi.volumeHandle
The path previously created.
A string containing the volumeType
(dir/v1
) filesystem name, and the directory path.
Example: dir/v1/podsFilesystem/my-dir
The filesystem and path must exist in the WEKA cluster.
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.