Skip to content

Commit 5658fa8

Browse files
Krisztian-MolnarBitnami Containers
and
Bitnami Containers
authoredOct 11, 2023
[bitnami/redis] Support persistentVolumeClaimRetentionPolicy for redis (#19689)
* feat: Added persistentVolumeClaimRetentionPolicy for redis master/replica/sentinel Signed-off-by: Krisztian Molnar <krisztian_molnar@epam.com> * Fix params in values.yaml Signed-off-by: Krisztian Molnar <krisztian_molnar@epam.com> * Remove manually added parts from readme Signed-off-by: Krisztian Molnar <krisztian_molnar@epam.com> * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Signed-off-by: Krisztian Molnar <krisztian_molnar@epam.com> * Add extra line with '##' after parameters Signed-off-by: Krisztian Molnar <krisztian_molnar@epam.com> * Fix reference to values Signed-off-by: Krisztian Molnar <krisztian_molnar@epam.com> * Pull original repo and bump chart version again Signed-off-by: Krisztian Molnar <krisztian_molnar@epam.com> --------- Signed-off-by: Krisztian Molnar <krisztian_molnar@epam.com> Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
1 parent 3b2560f commit 5658fa8

File tree

6 files changed

+55
-1
lines changed

6 files changed

+55
-1
lines changed
 

‎bitnami/redis/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ maintainers:
3434
name: redis
3535
sources:
3636
- https://github.com/bitnami/charts/tree/main/bitnami/redis
37-
version: 18.1.3
37+
version: 18.1.4

‎bitnami/redis/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ The command removes all the Kubernetes components associated with the chart and
208208
| `master.persistence.selector` | Additional labels to match for the PVC | `{}` |
209209
| `master.persistence.dataSource` | Custom PVC data source | `{}` |
210210
| `master.persistence.existingClaim` | Use a existing PVC which must be created manually before bound | `""` |
211+
| `master.persistentVolumeClaimRetentionPolicy.enabled` | Controls if and how PVCs are deleted during the lifecycle of a StatefulSet | `false` |
212+
| `master.persistentVolumeClaimRetentionPolicy.whenScaled` | Volume retention behavior when the replica count of the StatefulSet is reduced | `Retain` |
213+
| `master.persistentVolumeClaimRetentionPolicy.whenDeleted` | Volume retention behavior that applies when the StatefulSet is deleted | `Retain` |
211214
| `master.service.type` | Redis&reg; master service type | `ClusterIP` |
212215
| `master.service.ports.redis` | Redis&reg; master service port | `6379` |
213216
| `master.service.nodePorts.redis` | Node port for Redis&reg; master | `""` |
@@ -317,6 +320,9 @@ The command removes all the Kubernetes components associated with the chart and
317320
| `replica.persistence.selector` | Additional labels to match for the PVC | `{}` |
318321
| `replica.persistence.dataSource` | Custom PVC data source | `{}` |
319322
| `replica.persistence.existingClaim` | Use a existing PVC which must be created manually before bound | `""` |
323+
| `replica.persistentVolumeClaimRetentionPolicy.enabled` | Controls if and how PVCs are deleted during the lifecycle of a StatefulSet | `false` |
324+
| `replica.persistentVolumeClaimRetentionPolicy.whenScaled` | Volume retention behavior when the replica count of the StatefulSet is reduced | `Retain` |
325+
| `replica.persistentVolumeClaimRetentionPolicy.whenDeleted` | Volume retention behavior that applies when the StatefulSet is deleted | `Retain` |
320326
| `replica.service.type` | Redis&reg; replicas service type | `ClusterIP` |
321327
| `replica.service.ports.redis` | Redis&reg; replicas service port | `6379` |
322328
| `replica.service.nodePorts.redis` | Node port for Redis&reg; replicas | `""` |
@@ -404,6 +410,9 @@ The command removes all the Kubernetes components associated with the chart and
404410
| `sentinel.persistence.dataSource` | Custom PVC data source | `{}` |
405411
| `sentinel.persistence.medium` | Provide a medium for `emptyDir` volumes. | `""` |
406412
| `sentinel.persistence.sizeLimit` | Set this to enable a size limit for `emptyDir` volumes. | `""` |
413+
| `sentinel.persistentVolumeClaimRetentionPolicy.enabled` | Controls if and how PVCs are deleted during the lifecycle of a StatefulSet | `false` |
414+
| `sentinel.persistentVolumeClaimRetentionPolicy.whenScaled` | Volume retention behavior when the replica count of the StatefulSet is reduced | `Retain` |
415+
| `sentinel.persistentVolumeClaimRetentionPolicy.whenDeleted` | Volume retention behavior that applies when the StatefulSet is deleted | `Retain` |
407416
| `sentinel.resources.limits` | The resources limits for the Redis&reg; Sentinel containers | `{}` |
408417
| `sentinel.resources.requests` | The requested resources for the Redis&reg; Sentinel containers | `{}` |
409418
| `sentinel.containerSecurityContext.enabled` | Enabled Redis&reg; Sentinel containers' Security Context | `true` |

‎bitnami/redis/templates/master/application.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,11 @@ spec:
493493
persistentVolumeClaim:
494494
claimName: {{ printf "redis-data-%s-master" (include "common.names.fullname" .) }}
495495
{{- else }}
496+
{{- if .Values.master.persistentVolumeClaimRetentionPolicy.enabled }}
497+
persistentVolumeClaimRetentionPolicy:
498+
whenDeleted: {{ .Values.master.persistentVolumeClaimRetentionPolicy.whenDeleted }}
499+
whenScaled: {{ .Values.master.persistentVolumeClaimRetentionPolicy.whenScaled }}
500+
{{- end }}
496501
volumeClaimTemplates:
497502
- apiVersion: v1
498503
kind: PersistentVolumeClaim

‎bitnami/redis/templates/replicas/statefulset.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,11 @@ spec:
490490
persistentVolumeClaim:
491491
claimName: {{ printf "%s" (tpl .Values.replica.persistence.existingClaim .) }}
492492
{{- else }}
493+
{{- if .Values.replica.persistentVolumeClaimRetentionPolicy.enabled }}
494+
persistentVolumeClaimRetentionPolicy:
495+
whenDeleted: {{ .Values.replica.persistentVolumeClaimRetentionPolicy.whenDeleted }}
496+
whenScaled: {{ .Values.replica.persistentVolumeClaimRetentionPolicy.whenScaled }}
497+
{{- end }}
493498
volumeClaimTemplates:
494499
- apiVersion: v1
495500
kind: PersistentVolumeClaim

‎bitnami/redis/templates/sentinel/statefulset.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,11 @@ spec:
728728
persistentVolumeClaim:
729729
claimName: {{ printf "%s" (tpl .Values.replica.persistence.existingClaim .) }}
730730
{{- else }}
731+
{{- if .Values.sentinel.persistentVolumeClaimRetentionPolicy.enabled }}
732+
persistentVolumeClaimRetentionPolicy:
733+
whenDeleted: {{ .Values.sentinel.persistentVolumeClaimRetentionPolicy.whenDeleted }}
734+
whenScaled: {{ .Values.sentinel.persistentVolumeClaimRetentionPolicy.whenScaled }}
735+
{{- end }}
731736
volumeClaimTemplates:
732737
- apiVersion: v1
733738
kind: PersistentVolumeClaim

‎bitnami/redis/values.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,16 @@ master:
488488
## NOTE: requires master.persistence.enabled: true
489489
##
490490
existingClaim: ""
491+
## persistentVolumeClaimRetentionPolicy
492+
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention
493+
## @param master.persistentVolumeClaimRetentionPolicy.enabled Controls if and how PVCs are deleted during the lifecycle of a StatefulSet
494+
## @param master.persistentVolumeClaimRetentionPolicy.whenScaled Volume retention behavior when the replica count of the StatefulSet is reduced
495+
## @param master.persistentVolumeClaimRetentionPolicy.whenDeleted Volume retention behavior that applies when the StatefulSet is deleted
496+
##
497+
persistentVolumeClaimRetentionPolicy:
498+
enabled: false
499+
whenScaled: Retain
500+
whenDeleted: Retain
491501
## Redis&reg; master service parameters
492502
##
493503
service:
@@ -921,6 +931,16 @@ replica:
921931
## NOTE: requires replica.persistence.enabled: true
922932
##
923933
existingClaim: ""
934+
## persistentVolumeClaimRetentionPolicy
935+
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention
936+
## @param replica.persistentVolumeClaimRetentionPolicy.enabled Controls if and how PVCs are deleted during the lifecycle of a StatefulSet
937+
## @param replica.persistentVolumeClaimRetentionPolicy.whenScaled Volume retention behavior when the replica count of the StatefulSet is reduced
938+
## @param replica.persistentVolumeClaimRetentionPolicy.whenDeleted Volume retention behavior that applies when the StatefulSet is deleted
939+
##
940+
persistentVolumeClaimRetentionPolicy:
941+
enabled: false
942+
whenScaled: Retain
943+
whenDeleted: Retain
924944
## Redis&reg; replicas service parameters
925945
##
926946
service:
@@ -1219,6 +1239,16 @@ sentinel:
12191239
## @param sentinel.persistence.sizeLimit Set this to enable a size limit for `emptyDir` volumes.
12201240
##
12211241
sizeLimit: ""
1242+
## persistentVolumeClaimRetentionPolicy
1243+
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention
1244+
## @param sentinel.persistentVolumeClaimRetentionPolicy.enabled Controls if and how PVCs are deleted during the lifecycle of a StatefulSet
1245+
## @param sentinel.persistentVolumeClaimRetentionPolicy.whenScaled Volume retention behavior when the replica count of the StatefulSet is reduced
1246+
## @param sentinel.persistentVolumeClaimRetentionPolicy.whenDeleted Volume retention behavior that applies when the StatefulSet is deleted
1247+
##
1248+
persistentVolumeClaimRetentionPolicy:
1249+
enabled: false
1250+
whenScaled: Retain
1251+
whenDeleted: Retain
12221252
## Redis&reg; Sentinel resource requests and limits
12231253
## ref: https://kubernetes.io/docs/user-guide/compute-resources/
12241254
## @param sentinel.resources.limits The resources limits for the Redis&reg; Sentinel containers

0 commit comments

Comments
 (0)
Please sign in to comment.