StorageClass parameters

Cache sizing, QoS, encryption and compression are all StorageClass parameters, which means they are chosen per class and fixed for the volumes that class creates. Running two profiles — a database class and an archive class, say — means two StorageClasses against the same pool.

Set them at install time with --set storageclass.<key>=..., or author a StorageClass of your own with the parameters in the middle column.

Parameters

Helm valueParameterDefaultDescription
configconfigserver defaultStorage config profile name. Leave unset and the pool defaults it.
labelslabelsstorage=mgxLabels applied to the volume.
minCacheRCacheSizemin_cache_r_cache_size1024Read-cache floor, MiB.
minCacheRWCacheSizemin_cache_rw_cache_size1024Write-cache floor, MiB.
maxCacheRCacheSizemax_cache_r_cache_size20480Read-cache ceiling, MiB.
maxCacheRWCacheSizemax_cache_rw_cache_size3072Write-cache ceiling, MiB.
ratioCacheRCacheSizeratio_cache_r_cache_size0.1Read cache as a ratio of volume size.
ratioCacheRWCacheSizeratio_cache_rw_cache_size0.05Write cache as a ratio of volume size.
qosRMBPerSecqos_r_mbytes_per_secunsetRead bandwidth cap, MB/s.
qosWMBPerSecqos_w_mbytes_per_secunsetWrite bandwidth cap, MB/s.
qosRWMBPerSecqos_rw_mbytes_per_secunsetCombined read+write bandwidth cap, MB/s.
qosRWIOPSqos_rw_ios_per_secunsetCombined read+write IOPS cap.
storageEncryptSecretstorage_encrypt_secretunsetName of the encryption secret. Unset means no encryption.
storageCompressstorage_compressunsetCompression level, 09.
reclaimPolicyDeleteDelete or Retain.

Classes are created with volumeBindingMode: Immediate and allowVolumeExpansion: true.

A QoS or storage parameter left unset is omitted from the class entirely rather than sent as a zero, so the pool's own default applies.

Cache sizing

The two cache sizes are computed at volume creation as

text
clamp(ratio * volume size in MiB, floor, ceiling)

which is why the ratio alone does not tell you the answer — see Caching for worked examples and for what to tune when a working set does not fit.

A hand-written class

Everything above as YAML, for the case where you want a second profile rather than to change the chart's:

yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: mgxcsi-sc-db
provisioner: csi.migrx.io
parameters:
  labels: "storage=mgx,profile=db"
  min_cache_r_cache_size: "4096"
  min_cache_rw_cache_size: "2048"
  max_cache_r_cache_size: "65536"
  max_cache_rw_cache_size: "8192"
  ratio_cache_r_cache_size: "0.2"
  ratio_cache_rw_cache_size: "0.1"
  qos_rw_ios_per_sec: "20000"
  storage_compress: "3"
reclaimPolicy: Retain
volumeBindingMode: Immediate
allowVolumeExpansion: true

Existing volumes keep the parameters they were created with; a class edit applies to volumes created after it.