This is an automated email from the ASF dual-hosted git repository.

jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new ed17399485b add redis statefulset persistentVolumeClaimRetentionPolicy 
support (#59955)
ed17399485b is described below

commit ed17399485b7cef4720064e1d742d23e917b479b
Author: pgvishnuram <[email protected]>
AuthorDate: Wed Dec 31 23:03:14 2025 +0530

    add redis statefulset persistentVolumeClaimRetentionPolicy support (#59955)
---
 chart/templates/redis/redis-statefulset.yaml | 6 +++++-
 chart/values.schema.json                     | 4 ++++
 chart/values.yaml                            | 5 +++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/chart/templates/redis/redis-statefulset.yaml 
b/chart/templates/redis/redis-statefulset.yaml
index 1d23401335c..f3e5474369c 100644
--- a/chart/templates/redis/redis-statefulset.yaml
+++ b/chart/templates/redis/redis-statefulset.yaml
@@ -28,6 +28,7 @@
 {{- $securityContext := include "localPodSecurityContext" .Values.redis }}
 {{- $containerSecurityContext := include "externalContainerSecurityContext" 
.Values.redis }}
 {{- $containerLifecycleHooks := .Values.redis.containerLifecycleHooks }}
+{{- $persistence := .Values.redis.persistence.enabled }}
 apiVersion: apps/v1
 kind: StatefulSet
 metadata:
@@ -46,6 +47,9 @@ metadata:
   {{- end }}
 spec:
   serviceName: {{ include "airflow.fullname" . }}-redis
+  {{- if and $persistence 
.Values.redis.persistence.persistentVolumeClaimRetentionPolicy }}
+  persistentVolumeClaimRetentionPolicy: {{- toYaml 
.Values.redis.persistence.persistentVolumeClaimRetentionPolicy | nindent 4 }}
+  {{- end }}
   selector:
     matchLabels:
       tier: airflow
@@ -109,7 +113,7 @@ spec:
                 secretKeyRef:
                   name: {{ template "redis_password_secret" . }}
                   key: password
-  {{- if not .Values.redis.persistence.enabled }}
+  {{- if not $persistence }}
       volumes:
         - name: redis-db
           emptyDir: {{- toYaml (default (dict) .Values.redis.emptyDirConfig) | 
nindent 12 }}
diff --git a/chart/values.schema.json b/chart/values.schema.json
index 1ec5a917ebd..0b972d67e78 100644
--- a/chart/values.schema.json
+++ b/chart/values.schema.json
@@ -8257,6 +8257,10 @@
                                 "null"
                             ],
                             "default": null
+                        },
+                        "persistentVolumeClaimRetentionPolicy": {
+                            "$ref": 
"#/definitions/persistentVolumeClaimRetentionPolicy",
+                            "description": "PersistentVolumeClaim retention 
policy to be used in the lifecycle of a StatefulSet."
                         }
                     }
                 },
diff --git a/chart/values.yaml b/chart/values.yaml
index 4067237fc48..2d69fc6094d 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -2746,6 +2746,11 @@ redis:
     # the name of an existing PVC to use
     existingClaim:
 
+    persistentVolumeClaimRetentionPolicy: ~
+    # persistentVolumeClaimRetentionPolicy:
+    #   whenDeleted: Delete
+    #   whenScaled: Delete
+
   # Configuration for empty dir volume (if redis.persistence.enabled == false)
   # emptyDirConfig:
   #   sizeLimit: 1Gi

Reply via email to