feat(helm): optional volumeAttributesClassName on every PVC (#12996)

* feat(helm): optional volumeAttributesClassName on every PVC

The chart's claims only take storageClass, size and annotations, so
provisioned performance (IOPS/throughput on GKE Hyperdisk, EBS gp3,
Azure Premium v2) can only be set through a custom StorageClass. A
VolumeAttributesClass is the Kubernetes way to do that and can be
changed later without recreating the volume.

Every claim the chart renders now takes an optional
volumeAttributesClassName next to its storageClass: master.data/logs,
filer.data/logs and the deprecated filer.volumeAttributesClassName,
admin.data/logs, volume.dataDirs[]/idx/logs (and volumes.<name>), and
allInOne.data. It is rendered only when set, so default renders are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* helm: quote volumeAttributesClassName so names like 2026 or null stay strings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* helm: say existing claims need a patch to change their volumeAttributesClassName

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-11-25 13:13:58 -08:00
1 parent 37c0b2f162
commit ff80650b85
8 files changed
+80

No files matched your search

+20
View File
@@ -162,6 +162,26 @@ jobs:
done
echo "shareProcessNamespace renders correctly"
echo "=== Testing volumeAttributesClassName ==="
pvc_args=(--set allInOne.enabled=true --set allInOne.data.type=persistentVolumeClaim
--set admin.enabled=true --set admin.allowInsecureBind=true --set volume.dataDirs[0].name=data1)
for claim in master.data master.logs filer.data filer.logs admin.data admin.logs \
volume.idx volume.logs volume.dataDirs[0]; do
pvc_args+=(--set "$claim.type=persistentVolumeClaim" --set "$claim.size=1Gi")
done
helm template test $CHART_DIR "${pvc_args[@]}" > /tmp/vac-default.yaml
test "$(grep -c 'volumeAttributesClassName' /tmp/vac-default.yaml)" -eq 0
for claim in master.data master.logs filer.data filer.logs admin.data admin.logs \
volume.idx volume.logs volume.dataDirs[0] allInOne.data; do
pvc_args+=(--set "$claim.volumeAttributesClassName=fast")
done
helm template test $CHART_DIR "${pvc_args[@]}" > /tmp/vac.yaml
test "$(grep -c '^ *volumeAttributesClassName: "fast"$' /tmp/vac.yaml)" -eq 10
helm template test $CHART_DIR --set master.data.type=persistentVolumeClaim \
--set-string master.data.volumeAttributesClassName=null > /tmp/vac-null.yaml
grep -q '^ *volumeAttributesClassName: "null"$' /tmp/vac-null.yaml
echo "volumeAttributesClassName renders correctly"
echo "=== Testing the S3 config reloader ==="
for workload in filer.s3:templates/filer/filer-statefulset.yaml s3:templates/s3/s3-deployment.yaml; do
prefix=${workload%%:*}
+12
View File
@@ -122,6 +122,18 @@ https://github.com/rancher/local-path-provisioner
you can use ANY storage class you like, just update the correct storage-class
for your deployment.
Every claim the chart creates also takes an optional `volumeAttributesClassName`
next to its `storageClass` (for example `master.data.volumeAttributesClassName`
or `volume.dataDirs[].volumeAttributesClassName`), to set provisioned
performance such as IOPS and throughput through a
[VolumeAttributesClass](https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/).
It needs Kubernetes 1.34+, or 1.31+ with the `VolumeAttributesClass` feature gate.
`volumeClaimTemplates` cannot be changed on an existing StatefulSet, and a new
template only reaches claims created after it. To set it on a release that
already exists, patch `spec.volumeAttributesClassName` on each existing claim,
and delete the StatefulSet with `--cascade=orphan` before the upgrade so the
upgrade can apply the new template.
### Master data: hostPath vs a claim
The master's `-mdir` holds its Raft log and snapshots, and with them the
@@ -359,6 +359,9 @@ spec:
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.admin.data.storageClass }}
{{- with .Values.admin.data.volumeAttributesClassName }}
volumeAttributesClassName: {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.admin.data.size }}
@@ -373,6 +376,9 @@ spec:
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.admin.logs.storageClass }}
{{- with .Values.admin.logs.volumeAttributesClassName }}
volumeAttributesClassName: {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.admin.logs.size }}
@@ -22,6 +22,9 @@ spec:
{{- if .Values.allInOne.data.storageClass }}
storageClassName: {{ .Values.allInOne.data.storageClass }}
{{- end }}
{{- with .Values.allInOne.data.volumeAttributesClassName }}
volumeAttributesClassName: {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.allInOne.data.size | default "10Gi" }}
@@ -510,6 +510,9 @@ spec:
{{- if .Values.filer.storageClass }}
storageClassName: {{ .Values.filer.storageClass }}
{{- end }}
{{- with .Values.filer.volumeAttributesClassName }}
volumeAttributesClassName: {{ . | quote }}
{{- end }}
{{- end }}
{{- $pvc_exists := include "seaweedfs.filer.pvc_exists" . -}}
{{- if $pvc_exists }}
@@ -526,6 +529,9 @@ spec:
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.filer.data.storageClass }}
{{- with .Values.filer.data.volumeAttributesClassName }}
volumeAttributesClassName: {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.filer.data.size }}
@@ -542,6 +548,9 @@ spec:
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.filer.logs.storageClass }}
{{- with .Values.filer.logs.volumeAttributesClassName }}
volumeAttributesClassName: {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.filer.logs.size }}
@@ -340,6 +340,9 @@ spec:
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.master.data.storageClass }}
{{- with .Values.master.data.volumeAttributesClassName }}
volumeAttributesClassName: {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.master.data.size }}
@@ -356,6 +359,9 @@ spec:
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ .Values.master.logs.storageClass }}
{{- with .Values.master.logs.volumeAttributesClassName }}
volumeAttributesClassName: {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.master.logs.size }}
@@ -412,6 +412,9 @@ spec:
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ $dir.storageClass }}
{{- with $dir.volumeAttributesClassName }}
volumeAttributesClassName: {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ $dir.size }}
@@ -430,6 +433,9 @@ spec:
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ $volume.idx.storageClass }}
{{- with $volume.idx.volumeAttributesClassName }}
volumeAttributesClassName: {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ $volume.idx.size }}
@@ -446,6 +452,9 @@ spec:
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: {{ $volume.logs.storageClass }}
{{- with $volume.logs.volumeAttributesClassName }}
volumeAttributesClassName: {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ $volume.logs.size }}
+15
View File
@@ -151,12 +151,14 @@ master:
# Enter any extra configuration for master.toml here.
# It may be a multi-line string.
# volumeAttributesClassName (optional) needs Kubernetes 1.34+, or 1.31+ with the VolumeAttributesClass feature gate.
# You may use ANY storage-class, example with local-path-provisioner
# Annotations are optional.
# data:
# type: "persistentVolumeClaim"
# size: "24Ti"
# storageClass: "local-path-provisioner"
# volumeAttributesClassName: "my-attributes-class"
# annotations:
# "key": "value"
#
@@ -184,6 +186,7 @@ master:
# type: "persistentVolumeClaim"
# size: "24Ti"
# storageClass: "local-path-provisioner"
# volumeAttributesClassName: "my-attributes-class"
# annotations:
# "key": "value"
@@ -416,6 +419,7 @@ volume:
# extraArgs: ["-customFlag", "value", "-anotherFlag"]
extraArgs: []
# volumeAttributesClassName (optional) needs Kubernetes 1.34+, or 1.31+ with the VolumeAttributesClass feature gate.
# For each data disk you may use ANY storage-class, example with local-path-provisioner
# Annotations are optional.
# dataDirs:
@@ -423,6 +427,7 @@ volume:
# type: "persistentVolumeClaim"
# size: "24Ti"
# storageClass: "local-path-provisioner"
# volumeAttributesClassName: "my-attributes-class"
# annotations:
# "key": "value"
# maxVolumes: 0 # If set to zero on non-windows OS, the limit will be auto configured. (default "7")
@@ -477,6 +482,7 @@ volume:
# type: "persistentVolumeClaim"
# size: "20Gi"
# storageClass: "local-path-provisioner"
# volumeAttributesClassName: "my-attributes-class"
#
# or
#
@@ -799,12 +805,16 @@ filer:
storage: 25Gi
# storageClass is the class of storage which defaults to null (the Kube cluster will pick the default).
storageClass: null
# volumeAttributesClassName is the VolumeAttributesClass of the enablePVC claim; null leaves it unset.
volumeAttributesClassName: null
# volumeAttributesClassName (optional) needs Kubernetes 1.34+, or 1.31+ with the VolumeAttributesClass feature gate.
# You may use ANY storage-class, example with local-path-provisioner
# Annotations are optional.
# data:
# type: "persistentVolumeClaim"
# size: "24Ti"
# storageClass: "local-path-provisioner"
# volumeAttributesClassName: "my-attributes-class"
# annotations:
# "key": "value"
#
@@ -828,6 +838,7 @@ filer:
# type: "persistentVolumeClaim"
# size: "24Ti"
# storageClass: "local-path-provisioner"
# volumeAttributesClassName: "my-attributes-class"
# annotations:
# "key": "value"
@@ -1633,10 +1644,12 @@ admin:
extraArgs: []
# Storage configuration
# volumeAttributesClassName (optional) needs Kubernetes 1.34+, or 1.31+ with the VolumeAttributesClass feature gate.
data:
type: "emptyDir" # Options: "hostPath", "persistentVolumeClaim", "emptyDir", "existingClaim"
size: "10Gi"
storageClass: ""
volumeAttributesClassName: ""
hostPathPrefix: /storage
claimName: ""
annotations: {}
@@ -1645,6 +1658,7 @@ admin:
type: "emptyDir" # Options: "hostPath", "persistentVolumeClaim", "emptyDir", "existingClaim"
size: "5Gi"
storageClass: ""
volumeAttributesClassName: ""
hostPathPrefix: /storage
claimName: ""
annotations: {}
@@ -2140,6 +2154,7 @@ allInOne:
claimName: seaweedfs-data-pvc # Name of the PVC to use (for existingClaim type)
size: null # Size of the PVC (null defaults to 10Gi for persistentVolumeClaim type)
storageClass: null # Storage class for the PVC (null uses cluster default)
volumeAttributesClassName: null # VolumeAttributesClass for the PVC; needs Kubernetes 1.34+, or 1.31+ with the feature gate
# accessModes for the PVC. Default is ["ReadWriteOnce"].
# For multi-replica deployments, use ["ReadWriteMany"] with a compatible storage class.
accessModes: []