- This example concentrates on Weka snapshot-backed volume and its derivatives
- Upon first CSI volume creation, a new read-only snapshot of empty filesystem is produced, called a seed snapshot
- Since that moment:
- every new blank CSI volume maps to a new writable snapshot of the seed snapshot
- every snapshot of the volume maps to a new read-only snapshot of itself
- every volume created from snapshot maps to a new writable snapshot of the originating CSI snapshot (which is a Weka read-only snapshot)
- every cloned volume maps to a new writable snapshot of the originating CSI volume (which is a Weka writable snapshot)
WARNING: Filesystem provided for Weka CSI Plugin must be empty at least at the moment of first CSI volume provisioning. This is required for the plugin to be able to create a seed snapshot (a snapshot of the filesystem in empty state)
This example introduces automatic provisioning of filesystems. For this functionality to work, the following configuration must be set:
.Values.pluginConfig.allowedOperations.autoExpandFilesystems = true # to allow resizing of filesystem if snapshot-backed volume is of a larger size
NOTE: Those values are set by default
Weka software of version below 4.2 does not support enforcement of quotas on filesystem snapshots. Hence, CSI plugin forbids creation of snapshot-backed volumes on clusters having an older version by default. As a result, provisioning a snapshot-backed volume on such cluster will fail with a message similar to this:
failed to provision volume with StorageClass "storageclass-wekafs-snap-api": rpc error: code = FailedPrecondition desc = Quota enforcement is not supported for snapshot-backed volumes by current Weka software version, please upgrade Weka cluster
This behavior may be adjusted, so snapshot-backed volumes will be allowed on older versions of Weka as well, by setting
.Values.pluginConfig.allowedOperations.snapshotVolumesWithoutQuotaEnforcement=true
WARNING: Capacity will not be enforced for such volumes until Weka software is upgraded to supported version
NOTE: No user action is required to enable capacity enforcement upon the storage cluster upgrade
- Storage class specifies the filesystemName to provision the filesystems in
- volumeType set to
weka/v2
or is unset at all
NOTE: It is important to mention that the difference from directory-backed storageClass is only the volumeType
All commands below may be executed by
kubectl apply -f <FILE>.yaml
- Create storageclass
storageclass-wekafs-snap-api
- Create CSI secret
csi-wekafs-api-secret
(Located in ../common/csi-wekafs-api-secret.yaml) - Create snapshotclass
snapshotclass-csi-wekafs
(Located in ../common/snapshotclass-csi-wekafs.yaml) - Provision a new filesystem volume
pvc-wekafs-snap-api
- Create application that writes timestamp every 10 seconds into
/data/temp.txt
:csi-app-on-snap-api
- Create a snapshot of the PVC:
snapshot-pvc-wekafs-snap-api
- Create a new volume from snapshot:
pvc-wekafs-snap-snapshot
- Create application that tails content of
/data/temp.txt
from volume created from snapshot:csi-app-on-snap-snapshot
- the file should exist and be accessible
- the latest timestamp you are expected to see is the timestamp just before creation of snapshot
- Create a new volume straight from original volume (e.g. clone volume):
pvc-wekafs-snap-clone
- Create application that tails content of
/data/temp.txt
from volume created from snapshot:csi-app-on-snap-clone
- the file should exist and be accessible
- the latest timestamp you are expected to see is the timestamp just before volume cloning