diff --git a/charts/redis-ha/Chart.yaml b/charts/redis-ha/Chart.yaml index d4e21a86..85bbf734 100644 --- a/charts/redis-ha/Chart.yaml +++ b/charts/redis-ha/Chart.yaml @@ -5,7 +5,7 @@ keywords: - redis - keyvalue - database -version: 4.39.0 +version: 4.39.1 appVersion: 8.8.0 description: This Helm chart provides a highly available Redis implementation with a master/slave configuration and uses Sentinel sidecars for failover management icon: https://img.icons8.com/external-tal-revivo-shadow-tal-revivo/24/external-redis-an-in-memory-data-structure-project-implementing-a-distributed-logo-shadow-tal-revivo.png diff --git a/charts/redis-ha/README.md b/charts/redis-ha/README.md index 56eaf46b..fc11eec6 100644 --- a/charts/redis-ha/README.md +++ b/charts/redis-ha/README.md @@ -106,6 +106,10 @@ The following table lists the configurable parameters of the Redis chart and the | `persistentVolume.labels` | Labels for the volume | object | `{}` | | `persistentVolume.size` | Persistent volume size | string | `"10Gi"` | | `persistentVolume.storageClass` | redis-ha data Persistent Volume Storage Class | string | `nil` | +| `persistentVolumeClaimRetentionPolicy` | Configure whether PersistentVolumeClaims created by the StatefulSet are retained or deleted when the StatefulSet is deleted or scaled down. Requires Kubernetes support for StatefulSet PersistentVolumeClaim retention. | object | `{"enabled":false,"whenDeleted":"Retain","whenScaled":"Retain"}` | +| `persistentVolumeClaimRetentionPolicy.enabled` | Enable StatefulSet PersistentVolumeClaim retention policy | bool | `false` | +| `persistentVolumeClaimRetentionPolicy.whenDeleted` | PVC retention behavior when the StatefulSet is deleted. Allowed values: Retain, Delete | string | `"Retain"` | +| `persistentVolumeClaimRetentionPolicy.whenScaled` | PVC retention behavior when the StatefulSet is scaled down. Allowed values: Retain, Delete | string | `"Retain"` | | `podDisruptionBudget` | Pod Disruption Budget rules | object | `{}` | | `podManagementPolicy` | The statefulset pod management policy | string | `"OrderedReady"` | | `priorityClassName` | Kubernetes priorityClass name for the redis-ha-server pod | string | `""` | diff --git a/charts/redis-ha/templates/redis-ha-statefulset.yaml b/charts/redis-ha/templates/redis-ha-statefulset.yaml index bab5ea73..de707764 100644 --- a/charts/redis-ha/templates/redis-ha-statefulset.yaml +++ b/charts/redis-ha/templates/redis-ha-statefulset.yaml @@ -23,6 +23,11 @@ spec: serviceName: {{ template "redis-ha.fullname" . }} replicas: {{ .Values.replicas }} podManagementPolicy: {{ .Values.podManagementPolicy }} + {{- if .Values.persistentVolumeClaimRetentionPolicy.enabled }} + persistentVolumeClaimRetentionPolicy: + whenDeleted: {{ .Values.persistentVolumeClaimRetentionPolicy.whenDeleted }} + whenScaled: {{ .Values.persistentVolumeClaimRetentionPolicy.whenScaled }} + {{- end }} updateStrategy: type: {{ .Values.redis.updateStrategy.type }} {{- if .Values.redis.minReadySeconds }} diff --git a/charts/redis-ha/values.yaml b/charts/redis-ha/values.yaml index 95ad969f..58c4d403 100644 --- a/charts/redis-ha/values.yaml +++ b/charts/redis-ha/values.yaml @@ -914,6 +914,18 @@ persistentVolume: annotations: {} # -- Labels for the volume labels: {} + +# -- Configure whether PersistentVolumeClaims created by the StatefulSet are +# retained or deleted when the StatefulSet is deleted or scaled down. +# Requires Kubernetes support for StatefulSet PersistentVolumeClaim retention. +persistentVolumeClaimRetentionPolicy: + # -- Enable StatefulSet PersistentVolumeClaim retention policy + enabled: false + # -- PVC retention behavior when the StatefulSet is deleted. Allowed values: Retain, Delete + whenDeleted: Retain + # -- PVC retention behavior when the StatefulSet is scaled down. Allowed values: Retain, Delete + whenScaled: Retain + init: # -- Extra init resources resources: {}