Compression Support

Provides support for compressing files, typically on some schedule with cronjobs.

The files will not be compressed until a cronjob runs. As files are created or modified, they will be uncompressed until the job runs again. When the storage class is created with compression: true, the fileset created in the IBM Storage Scale file system will have a name appended to it such as -COMPRESSZcsi. The compression field is optional, and by default is "false", which means that no files are compressed within that PV.

A sample storage class with compression enabled:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
    name: ibm-spectrum-scale-compression
parameters:
    version: "2"
    volBackendFs: fs0
    compression: "true" # Default: false
provisioner: spectrumscale.csi.ibm.com
reclaimPolicy: Delete
Perform the following steps to create a cronjob:
  1. Create compression policy file.
    $ echo "RULE 'FSETCOMPRESSION' MIGRATE COMPRESS('z') WHERE FILESET_NAME LIKE '%COMPRESSZcsi%'" > zcompress.policy
    $ chmod 400 zcompress.policy
  2. Create a crontab entry on the owning cluster of the file system to run compression policy.
    $ crontab -e
    # insert line
    0 0 * * * /usr/lpp/mmfs/bin/mmapplypolicy <filesystemName> -P zcompress.policy -I yes
    # save and quit