From 6963b898ee3e427bb1419291abf5ef20c142b2f4 Mon Sep 17 00:00:00 2001 From: majinghe <42570491+majinghe@users.noreply.github.com> Date: Tue, 7 Apr 2026 13:34:49 +0800 Subject: [PATCH] feat: add support for pvc customized annotations (#2412) --- helm/README.md | 3 ++- helm/rustfs/templates/pvc.yaml | 6 ++++++ helm/rustfs/templates/statefulset.yaml | 6 ++++++ helm/rustfs/values.yaml | 4 ++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/helm/README.md b/helm/README.md index 5a7e4e0b9..7b60475f5 100644 --- a/helm/README.md +++ b/helm/README.md @@ -47,7 +47,7 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m | config.rustfs.obs_endpoint.logs.endpoint | string | `""` | Remote endpoint url for logs. | | config.rustfs.obs_endpoint.profiling.enabled | bool | `false` | Whether to send profiling to remote endpoint. | | config.rustfs.obs_endpoint.profiling.endpoint | string | `""` | Remote endpoint url for profiling. | -| extraEnv | list | `[]` | Extra environment variables for RustFS container. | +| extraEnv | map | `[]` | Extra environment variables for RustFS container. | | containerSecurityContext.capabilities.drop[0] | string | `"ALL"` | | | containerSecurityContext.readOnlyRootFilesystem | bool | `true` | | | containerSecurityContext.runAsNonRoot | bool | `true` | | @@ -133,6 +133,7 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m | storageclass.dataStorageSize | string | `"256Mi"` | The storage size for data PVC. | | storageclass.logStorageSize | string | `"256Mi"` | The storage size for logs PVC. | | storageclass.name | string | `"local-path"` | The name for StorageClass. | +| storageclass.pvcAnnotations | map | `{}` | PVC customized annotations. | | tolerations | list | `[]` | | | gatewayApi.enabled | bool | `false` | To enable/disable gateway api support. | | gatewayApi.gatewayClass | string | `traefik` | Gateway class implementation. | diff --git a/helm/rustfs/templates/pvc.yaml b/helm/rustfs/templates/pvc.yaml index 9e5a9b388..f6da122fc 100644 --- a/helm/rustfs/templates/pvc.yaml +++ b/helm/rustfs/templates/pvc.yaml @@ -5,6 +5,9 @@ kind: PersistentVolumeClaim metadata: annotations: helm.sh/resource-policy: keep + {{- with .pvcAnnotations }} + {{- toYaml .| nindent 4 }} + {{- end }} name: {{ include "rustfs.fullname" $ }}-data namespace: {{ $.Release.Namespace }} labels: @@ -28,6 +31,9 @@ kind: PersistentVolumeClaim metadata: annotations: helm.sh/resource-policy: keep + {{- with .pvcAnnotations }} + {{- toYaml .| nindent 4 }} + {{- end }} name: {{ include "rustfs.fullname" $ }}-logs namespace: {{ $.Release.Namespace }} labels: diff --git a/helm/rustfs/templates/statefulset.yaml b/helm/rustfs/templates/statefulset.yaml index 89577c229..fd79ec15c 100644 --- a/helm/rustfs/templates/statefulset.yaml +++ b/helm/rustfs/templates/statefulset.yaml @@ -192,6 +192,8 @@ spec: name: logs labels: {{- toYaml .Values.commonLabels | nindent 10 }} + annotations: + {{- toYaml .Values.storageclass.pvcAnnotations | nindent 10 }} spec: accessModes: ["ReadWriteOnce"] storageClassName: {{ .Values.storageclass.name }} @@ -204,6 +206,8 @@ spec: name: data-rustfs-{{ $i }} labels: {{- toYaml $.Values.commonLabels | nindent 10 }} + annotations: + {{- toYaml $.Values.storageclass.pvcAnnotations | nindent 10 }} spec: accessModes: ["ReadWriteOnce"] storageClassName: {{ $.Values.storageclass.name }} @@ -216,6 +220,8 @@ spec: name: data labels: {{- toYaml .Values.commonLabels | nindent 10 }} + annotations: + {{- toYaml .Values.storageclass.pvcAnnotations | nindent 10 }} spec: accessModes: ["ReadWriteOnce"] storageClassName: {{ .Values.storageclass.name }} diff --git a/helm/rustfs/values.yaml b/helm/rustfs/values.yaml index 7156adfa2..064b7562f 100644 --- a/helm/rustfs/values.yaml +++ b/helm/rustfs/values.yaml @@ -264,6 +264,10 @@ storageclass: name: local-path dataStorageSize: 256Mi logStorageSize: 256Mi + pvcAnnotations: {} + # pvcAnnotations: + # - name: team + # value: "RustFS" pdb: create: false