diff --git a/bitnami/redis/CHANGELOG.md b/bitnami/redis/CHANGELOG.md index 3897d262b8ebc4..9e57631fe6451d 100644 --- a/bitnami/redis/CHANGELOG.md +++ b/bitnami/redis/CHANGELOG.md @@ -1,8 +1,12 @@ # Changelog -## 20.11.1 (2025-03-04) +## 20.11.2 (2025-03-04) -* [bitnami/redis] Disable all usages of usePasswordFiles if auth.enabled is unset ([#32253](https://github.com/bitnami/charts/pull/32253)) +* [bitnami/redis] - handle SIGTERM in `kubectl-shared` container ([#32085](https://github.com/bitnami/charts/pull/32085)) + +## 20.11.1 (2025-03-04) + +* [bitnami/redis] Disable all usages of usePasswordFiles if auth.enabled is unset (#32253) ([1642f81](https://github.com/bitnami/charts/commit/1642f819c11793ff688f96b831a80bef863d7f98)), closes [#32253](https://github.com/bitnami/charts/issues/32253) ## 20.11.0 (2025-03-03) diff --git a/bitnami/redis/Chart.yaml b/bitnami/redis/Chart.yaml index 2498a21f66de29..9abc2430e14f26 100644 --- a/bitnami/redis/Chart.yaml +++ b/bitnami/redis/Chart.yaml @@ -36,4 +36,4 @@ maintainers: name: redis sources: - https://github.com/bitnami/charts/tree/main/bitnami/redis -version: 20.11.1 +version: 20.11.2 diff --git a/bitnami/redis/templates/scripts-configmap.yaml b/bitnami/redis/templates/scripts-configmap.yaml index e83d43cb26f1e1..f39bd8b155417f 100644 --- a/bitnami/redis/templates/scripts-configmap.yaml +++ b/bitnami/redis/templates/scripts-configmap.yaml @@ -847,15 +847,23 @@ data: update-master-label.sh: | #!/bin/bash while true; do - while [ ! -f "/etc/shared/current" ]; do + while [ ! -f "/etc/shared/current" ] && [ ! -f "/etc/shared/terminate" ]; do sleep 1 done - echo "new master elected, updating label(s)..." - kubectl label pod --field-selector metadata.name="$(< "/etc/shared/current")" isMaster="true" --overwrite - kubectl label pod --field-selector metadata.name="$(< "/etc/shared/current")" app.kubernetes.io/role- - if [ -f /etc/shared/previous ]; then - kubectl label pod --field-selector metadata.name="$(< "/etc/shared/previous")" isMaster="false" --overwrite + + if [ -f "/etc/shared/current" ]; then + echo "new master elected, updating label(s)..." + kubectl label pod --field-selector metadata.name="$(< "/etc/shared/current")" isMaster="true" --overwrite + kubectl label pod --field-selector metadata.name="$(< "/etc/shared/current")" app.kubernetes.io/role- + if [ -f /etc/shared/previous ]; then + kubectl label pod --field-selector metadata.name="$(< "/etc/shared/previous")" isMaster="false" --overwrite + fi + rm "/etc/shared/current" "/etc/shared/previous" + fi + + if [ -f "/etc/shared/terminate" ]; then + echo "received signal to terminate" + exit fi - rm "/etc/shared/current" "/etc/shared/previous" done {{- end }} diff --git a/bitnami/redis/templates/sentinel/statefulset.yaml b/bitnami/redis/templates/sentinel/statefulset.yaml index df0579799d6444..618a9b565d3bdf 100644 --- a/bitnami/redis/templates/sentinel/statefulset.yaml +++ b/bitnami/redis/templates/sentinel/statefulset.yaml @@ -640,6 +640,12 @@ spec: image: {{ template "redis.kubectl.image" . }} imagePullPolicy: {{ .Values.kubectl.image.pullPolicy | quote }} command: {{- toYaml .Values.kubectl.command | nindent 12 }} + lifecycle: + preStop: + exec: + command: + - touch + - /etc/shared/terminate {{- if .Values.kubectl.containerSecurityContext.enabled }} securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.kubectl.containerSecurityContext "context" $) | nindent 12 }} {{- end }}