|
This is unreleased documentation for SUSE® Storage 1.11 (Dev). |
StorageClass Parameters
Overview
StorageClass as a resource object has several configurable parameters.
Example:
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: longhorn-test
provisioner: driver.longhorn.io
allowVolumeExpansion: true
reclaimPolicy: Delete
volumeBindingMode: Immediate
parameters:
backupTargetName: "default"
numberOfReplicas: "3"
staleReplicaTimeout: "2880"
fromBackup: ""
fsType: "ext4"
# mkfsParams: ""
# migratable: false
# encrypted: false
# dataLocality: "disabled"
# replicaAutoBalance: "ignored"
# diskSelector: "ssd,fast"
# nodeSelector: "storage,fast"
# recurringJobSelector: '[{"name":"snap-group", "isGroup":true},
# {"name":"backup", "isGroup":false}]'
# backingImageName: ""
# backingImageChecksum: ""
# backingImageDataSourceType: ""
# backingImageDataSourceParameters: ""
# unmapMarkSnapChainRemoved: "ignored"
# disableRevisionCounter: false
# replicaSoftAntiAffinity: "ignored"
# replicaZoneSoftAntiAffinity: "ignored"
# replicaDiskSoftAntiAffinity: "ignored"
# nfsOptions: "soft,timeo=150,retrans=3"
# dataEngine: "v1"
# freezeFSForSnapshot: "ignored"
Built-in Fields
Some fields are common to all Kubernetes storage classes. See also Kubernetes Storage Class.
Provisioner (field: provisioner)
Specifies the plugin that will be used for dynamic creation of persistent volumes. For SUSE Storage, that is always driver.longhorn.io.
Allow Volume Expansion (field: allowVolumeExpansion)
Default:
trueSee Kubernetes Storage Class: Allow Volume Expansion.
Reclaim Policy (field: reclaimPolicy)
Default:
DeleteSee Kubernetes Storage Class: Reclaim Policy.
Mount Options (field: mountOptions)
Default
[]See Kubernetes Storage Class: Mount Options.
Volume Binding Mode (field: volumeBindingMode)
Default
ImmediateSee Kubernetes Storage Class: Volume Binding Mode.
Longhorn-specific Parameters
Note that some of these parameters also exist and may be specified in global settings. When a volume is provisioned with Kubernetes against a particular StorageClass, StorageClass parameters override the global settings. These fields will be applied for new volume creation only. If a StorageClass is modified, neither Longhorn nor Kubernetes handles propagating changes to its parameters back to volumes previously created with it.
Number Of Replicas (field: parameters.numberOfReplicas)
Default:
3
The desired number of copies (replicas) for redundancy.
-
Must be between 1 and 20.
-
Replicas will be placed across the widest possible set of zones, nodes, and disks in a cluster, subject to other constraints, such as NodeSelector.
Global setting: Default Replica Count.
Stale Replica Timeout (field: parameters.staleReplicaTimeout)
Default:
30
Minutes after a replica is marked unhealthy before it is deemed useless for rebuilds and is just deleted.
From Backup (field: parameters.fromBackup)
Default:
""Example:"s3://backupbucket@us-east-1?volume=minio-vol01&backup=backup-eeb2782d5b2f42bb"
URL of a backup to be restored from.
FS Type (field: parameters.fsType)
Default:
ext4For more details, please check the Creating Longhorn Volumes with Kubernetes
Mkfs Params (field: parameters.mkfsParams)
Default:
""For more details, please check the Creating Longhorn Volumes with Kubernetes
Migratable (field: parameters.migratable)
Default:
false
Enables live migration capabilities for a Longhorn volume, allowing it to be migrated from one node to another while maintaining active I/O operations.
When to use:
-
migratable: true: For workloads requiring live migration. Must be used withReadWriteManyaccess mode andvolumeMode: Block. -
migratable: false: For standard volumes that do not require live migration capabilities.
|
For more details, please check the ReadWriteMany (RWX) Volume. |
Encrypted (field: parameters.encrypted)
Default:
falseFor more details, please check the Encrypted Volumes.
Data Locality (field: parameters.dataLocality)
Default:
disabled
If enabled, try to keep the data on the same node as the workload for better performance.
-
For
best-effort, a replica will be co-located if possible, but is permitted to find another node if not. -
For
strict-localthe Replica count should be 1, or volume creation will fail with a parameter validation error. -
If
strict-localis not possible for whatever other reason, volume creation will be failed. Astrict-localreplica that becomes displaced from its workload will be marked as"Stopped".
Global setting: Default Data Locality For more details, please check Data Locality.
Replica Auto-Balance (field: parameters.replicaAutoBalance)
Default:
ignored
If enabled, move replicas to more lightly loaded nodes.
-
ignoredmeans use the global setting. -
Other options are
disabled,least-effort,best-effort.
Global setting: Replica Auto Balance For more details, please check the Auto Balance Replicas.
Disk Selector (field: parameters.diskSelector)
Default:
""Example:"ssd,fast"
A list of tags to select which disks are candidates for replica placement.
For more details, please check the Storage Tags.
Node Selector (field: parameters.nodeSelector)
Default:
""Example:"storage,fast"
A list of tags to select which nodes are candidates for replica placement.
For more details, please check the Storage Tags.
Recurring Job Selector (field: parameters.recurringJobSelector)
Default:
""Example:[{"name":"backup", "isGroup":true}]
A list of recurring jobs that are to be run on a volume.
For more details, please check Create Recurring Backup/Snapshot Job.
Backing Image Name (field: parameters.backingImageName)
Default:
""See Backing Image
Backing Image Checksum (field: parameters.backingImageChecksum)
Default:
""See Backing Image
Backing Image Data Source Type (field: parameters.backingImageDataSourceType)
Default:
""See Backing Image
Backing Image Data Source Parameters (field: parameters.backingImageDataSourceParameters)
Default:
""See Backing Image
Unmap Mark Snap Chain Removed (field: parameters.unmapMarkSnapChainRemoved)
Default:
ignored
-
ignoredmeans use the global setting. -
Other values are
enabledanddisabled.
Global setting: Remove Snapshots During Filesystem Trim. For more details, please check the Trim Filesystem.
Disable Revision Counter (field: parameters.disableRevisionCounter)
Default:
true
Global setting: Disable Revision Counter. For more details, please check the Revision Counter.
Replica Soft Anti-Affinity (field: parameters.replicaSoftAntiAffinity)
Default:
ignored
-
ignoredmeans use the global setting. -
Other values are
enabledanddisabled.
Global setting: Replica Node Level Soft Anti-Affinity. For more details, please check the Scheduling and Best Practices.
Replica Zone Soft Anti-Affinity (field: parameters.replicaZoneSoftAntiAffinity)
Default:
ignored
-
ignoredmeans use the global setting. -
Other values are
enabledanddisabled.
Global setting: Replica Zone Level Soft Anti-Affinity. For more details, please check Scheduling.
Replica Disk Soft Anti-Affinity (field: parameters.replicaDiskSoftAntiAffinity)
Default:
ignored
-
ignoredmeans use the global setting. -
Other values are
enabledanddisabled.
Global setting: Replica Disk Level Soft Anti-Affinity. For more details, please check Scheduling.
NFS Options (field: parameters.nfsOptions)
Default:
""Example:"hard,sync"
-
Overrides for NFS mount of RWX volumes to the share-manager. Use this field with caution.
Built-in options vary by release. Check your release details before setting this.
For more details, please check the RWX Workloads.
Data Engine (field: parameters.dataEngine)
Default:
"v1"
-
Specify "v2" to enable the V2 Data Engine (experimental feature). When unspecified, Longhorn uses the default value ("v1").
Global setting: V2 Data Engine. More details in V2 Data Engine Quick Start.
Freeze Filesystem For Snapshot (field: parameters.freezeFilesystemForSnapshot)
Default:
ignored
-
ignoredinstructs Longhorn to use the global setting. -
Other values are
enabledanddisabled.
Global setting: Freeze File System For Snapshot.
Backup Target Name (field: parameters.backupTargetName)
Default:
default
-
More details are available in default backup target and Create Volumes.
Backup Block Size (field: parameters.backupBlockSize)
Default:
""
Example: "2Mi" or "16Mi"
A Kubernetes quantity string. Use an empty string "" to apply the global setting.
For more information, see:
Helm Installs
If SUSE Storage is installed via Helm, values in the default storage class can be set by editing the corresponding item in values.yaml. All of the Storage Class parameters have a prefix of persistence. For example, persistence.defaultNodeSelector.