From e26f37351dfbf4e2e8a7fcc362a698c9c10fd08a Mon Sep 17 00:00:00 2001 From: Scott Davidson <49713135+sd109@users.noreply.github.com> Date: Wed, 30 Jul 2025 03:35:59 +0100 Subject: [PATCH] Add Redis data retention policy config options (#9080) ### What problem does this PR solve? Adds configuration options to the RAGFlow Helm chart to set the Redis data retention policies. By default this feature is disabled to maintain support with older Kubernetes versions. https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention ### Type of change - [X] New Feature (non-breaking change which adds functionality) --- helm/templates/redis.yaml | 9 +++++++++ helm/values.yaml | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/helm/templates/redis.yaml b/helm/templates/redis.yaml index 8c94982e3..4bd37a19e 100644 --- a/helm/templates/redis.yaml +++ b/helm/templates/redis.yaml @@ -64,6 +64,15 @@ spec: {{- . | toYaml | nindent 12 }} {{- end }} {{- if .Values.redis.persistence.enabled }} + {{- with .Values.redis.persistence.retentionPolicy }} + persistentVolumeClaimRetentionPolicy: + {{- with .whenDeleted }} + whenDeleted: {{ . }} + {{- end }} + {{- with .whenScaled }} + whenScaled: {{ . }} + {{- end }} + {{- end }} volumeClaimTemplates: - metadata: name: redis-data diff --git a/helm/values.yaml b/helm/values.yaml index ded5bf5c1..405bf8202 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -187,6 +187,11 @@ redis: capacity: 5Gi persistence: enabled: true + # Set's the retention policy for the persistent storage (only available in k8s 1.32 or later) + # https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention + # retentionPolicy: + # whenDeleted: Delete + # whenScaled: Delete deployment: strategy: resources: