[bitnami/redis] feat: add support for sync checks on replica nodes with sentinel (#36461)

This commit is contained in:
Juan Ariza Toledano
2026-02-12 11:38:43 +01:00
committed by GitHub
parent 69f5d02d1d
commit 38684e07d2
5 changed files with 55 additions and 23 deletions

View File

@@ -1,8 +1,15 @@
# Changelog
## 23.0.5 (2025-12-09)
## 23.1.0 (2026-02-12)
* [bitnami/redis] Add support to redis master service with useHostnames false ([#35536](https://github.com/bitnami/charts/pull/35536))
* [bitnami/redis] feat: add support for sync checks on replica nodes with sentinel ([#36461](https://github.com/bitnami/charts/pull/36461))
## <small>23.0.5 (2025-12-11)</small>
* [bitnami/*][TNZ-62332] Modify charts' READMEs title (#36372) ([2012e46](https://github.com/bitnami/charts/commit/2012e46699f555bb1e10134691031975bb5ca50b)), closes [#36372](https://github.com/bitnami/charts/issues/36372)
* [bitnami/redis] Add support to redis master service with useHostnames false (#35536) ([de739bd](https://github.com/bitnami/charts/commit/de739bd74672bdfccdcac80feacf70fc89d4eb18)), closes [#35536](https://github.com/bitnami/charts/issues/35536)
* Change wording in Chart's READMEs (#36379) ([a4ef0a6](https://github.com/bitnami/charts/commit/a4ef0a63877fcf32895869ceef0916c15a4718e5)), closes [#36379](https://github.com/bitnami/charts/issues/36379)
* Remove TAC sentence present in some READMEs (#36381) ([e07d331](https://github.com/bitnami/charts/commit/e07d3319b61f49ddf6f431da3ed7ec0e0be3d5d0)), closes [#36381](https://github.com/bitnami/charts/issues/36381)
## <small>23.0.4 (2025-10-24)</small>

View File

@@ -38,4 +38,4 @@ maintainers:
name: redis
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/redis
version: 23.0.5
version: 23.1.0

View File

@@ -820,6 +820,7 @@ helm install my-release --set master.persistence.existingClaim=PVC_NAME oci://RE
| `sentinel.downAfterMilliseconds` | Timeout for detecting a Redis(R) node is down | `60000` |
| `sentinel.failoverTimeout` | Timeout for performing a election failover | `180000` |
| `sentinel.parallelSyncs` | Number of replicas that can be reconfigured in parallel to use the new master after a failover | `1` |
| `sentinel.replicaSyncCheck` | Wait for data full sync on replicas before marking them as ready (experimental) | `false` |
| `sentinel.configuration` | Configuration for Redis(R) Sentinel nodes | `""` |
| `sentinel.command` | Override default container command (useful when using custom images) | `[]` |
| `sentinel.args` | Override default container args (useful when using custom images) | `[]` |

View File

@@ -16,27 +16,25 @@ data:
ping_readiness_local.sh: |-
#!/bin/bash
timeout=$1
run_redis_command() {
{{- if .Values.tls.enabled }}
local args=("--tls" "-p" "$REDIS_PORT")
{{- if not (empty (include "redis.tlsCACert" .)) }}
args+=("--cacert" {{ template "redis.tlsCACert" . }})
{{- end }}
{{- if .Values.tls.authClients }}
args+=("--cert" {{ template "redis.tlsCert" . }} "--key" {{ template "redis.tlsCertKey" . }})
{{- end }}
{{- else }}
local args=("-p" "$REDIS_PORT")
{{- end }}
timeout -s 15 $timeout redis-cli "${args[@]}" "$@"
}
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
[[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD"
response=$(
timeout -s 15 $1 \
redis-cli \
-h localhost \
{{- if .Values.tls.enabled }}
-p $REDIS_TLS_PORT \
--tls \
{{- if not (empty (include "redis.tlsCACert" .)) }}
--cacert {{ template "redis.tlsCACert" . }} \
{{- end }}
{{- if .Values.tls.authClients }}
--cert {{ template "redis.tlsCert" . }} \
--key {{ template "redis.tlsCertKey" . }} \
{{- end }}
{{- else }}
-p $REDIS_PORT \
{{- end }}
ping
)
response=$(run_redis_command ping)
if [ "$?" -eq "124" ]; then
echo "Timed out"
exit 1
@@ -45,6 +43,28 @@ data:
echo "$response"
exit 1
fi
{{- if and .Values.sentinel.enabled .Values.sentinel.replicaSyncCheck }}
replication_info=$(run_redis_command info replication)
if [ "$?" -eq "124" ]; then
echo "Timed out"
exit 1
fi
role=$(echo "$replication_info" | grep role | cut -d: -f2 | tr -d '\r')
if [[ "$role" = "slave" ]] || [[ "$role" = "replica" ]]; then
master_link_status=$(echo "$replication_info" | grep master_link_status | cut -d: -f2 | tr -d '\r')
master_sync_in_progress=$(echo "$replication_info" | grep master_sync_in_progress | cut -d: -f2 | tr -d '\r')
if [[ "$master_link_status" != "up" ]]; then
echo "Replica link to master is DOWN"
exit 1
fi
if [[ "$master_sync_in_progress" != "0" ]]; then
echo "Replica is currently syncing data from master"
exit 1
fi
fi
{{- end }}
ping_liveness_local.sh: |-
#!/bin/bash
@@ -128,7 +148,7 @@ data:
printf "\nsentinel known-sentinel {{ .Values.sentinel.masterSet }} %s %s %s", IP, PORT, $0; FOUND_RUNID=0;
}
}
{{- end }}
{{- else }}
ping_readiness_master.sh: |-
#!/bin/bash
@@ -202,3 +222,4 @@ data:
"$script_dir/ping_liveness_local.sh" $1 || exit_status=$?
"$script_dir/ping_liveness_master.sh" $1 || exit_status=$?
exit $exit_status
{{- end }}

View File

@@ -1232,6 +1232,9 @@ sentinel:
## @param sentinel.parallelSyncs Number of replicas that can be reconfigured in parallel to use the new master after a failover
##
parallelSyncs: 1
## @param sentinel.replicaSyncCheck Wait for data full sync on replicas before marking them as ready (experimental)
##
replicaSyncCheck: false
## @param sentinel.configuration Configuration for Redis(R) Sentinel nodes
## ref: https://redis.io/topics/sentinel
##