-
Notifications
You must be signed in to change notification settings - Fork 112
Open
Description
Summary
I’m running a homelab Kubernetes cluster with multiple nodes. One node hosts a ZFS pool. I’m provisioning volumes over iSCSI via this Helm chart. I want different block sizes per StorageClass: PostgreSQL at 8K (to match its page size) and everything else (backup-like data) at the default 16K.
However, PVCs created from both StorageClasses end up with volblocksize=16K.
What I expected
StorageClass A (postgres):volblocksize=8KStorageClass B (default/backup):volblocksize=16K
What actually happened
- Both volumes are created with
volblocksize=16K.
Repro (abridged)
Abridged values.yaml:
csiDriver:
name: "org.democratic-csi.iscsi"
storageClasses:
- name: ssd-iscsi
defaultClass: false
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true
parameters:
fsType: xfs
volblocksize: 16K
- name: ssd-iscsi-2
defaultClass: false
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true
parameters:
fsType: xfs
volblocksize: 8K
driver:
config:
driver: zfs-generic-iscsi
sshConnection:
host: n2p1
username: democratic-csi
privateKey: |
-----BEGIN OPENSSH PRIVATE KEY-----
...
-----END OPENSSH PRIVATE KEY-----
zfs:
cli:
sudoEnabled: true
datasetProperties:
"volblocksize": "{{ parameters.volblocksize }}"
datasetParentName: nas/k8s
detachedSnapshotsDatasetParentName: tanks/k8s/test-snapshots
zvolEnableReservation: false# sudo zfs get volblocksize nas/k8s/pvc-c44942d4-0142-498c-aa93-051ac59afb34 nas/k8s/pvc-f000b4ba-2414-4cfe-8c43-fb2b6be8ad43
NAME PROPERTY VALUE SOURCE
nas/k8s/pvc-c44942d4-0142-498c-aa93-051ac59afb34 volblocksize 16K default
nas/k8s/pvc-f000b4ba-2414-4cfe-8c43-fb2b6be8ad43 volblocksize 16K default
What I found in the code
While tracing the provisioning path, I noticed that the value from datasetProperties.volblocksize is being overwritten later in the flow (
democratic-csi/src/driver/controller-zfs/index.js
Lines 1081 to 1084 in 8193b68
| // force blocksize on newly created zvols | |
| if (driverZfsResourceType == "volume") { | |
| volumeProperties.volblocksize = zvolBlocksize; | |
| } |
volblocksize to a fixed value regardless of what’s provided via datasetProperties in the StorageClass/values.
Questions
- Is there a specific reason
volblocksizefromdatasetPropertiesis always overwritten? - If not, can we change the precedence so that
datasetProperties(per StorageClass) has the highest priority?
Rationale
- PostgreSQL benefits from 8K blocks to align with its page size and reduce write amplification.
- Backup/archival data can stay on 16K to optimize throughput/fragmentation differently.
- Being able to tune this per StorageClass is a common operational need.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels