Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
[stable/redis-ha] Improve liveness probe for large databases (helm#14999
Browse files Browse the repository at this point in the history
)

* [stable/redis-ha] Improve liveness probe so that redis is not restarted while it is still loading its dataset into memory

On larger databases this can take more than just the initial probe delay. During this time redis will not answer the ping command with pong, but with loading. Of course the container should not be marked as ready, but it also should not restart which results in redis never starting successfully.

Signed-off-by: Bastian Hofmann <[email protected]>

* [stable/redis-ha] Bump version to 3.5.2

Signed-off-by: Bastian Hofmann <[email protected]>
Signed-off-by: Andrii Nasinnyk <[email protected]>
  • Loading branch information
bashofmann authored and anasinnyk committed Jun 29, 2019
1 parent 6d32e1b commit 96dbfd3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stable/redis-ha/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
- redis
- keyvalue
- database
version: 3.5.1
version: 3.5.2
appVersion: 5.0.3
description: Highly available Kubernetes implementation of Redis
icon: https://upload.wikimedia.org/wikipedia/en/thumb/6/6b/Redis_Logo.svg/1200px-Redis_Logo.svg.png
Expand Down
10 changes: 10 additions & 0 deletions stable/redis-ha/templates/redis-ha-healthchecks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,13 @@ data:
echo "Server check failed with: $CHECK_SERVER"
exit 1
fi
liveness.sh: |
#!/bin/sh
set -eu
CHECK_SERVER="$(redis-cli -p "$1"{{ if .Values.auth }} -a "$AUTH"{{ end }} ping)"
if [ "$CHECK_SERVER" != "PONG" ] && [ "$CHECK_SERVER" != "LOADING Redis is loading the dataset in memory" ]; then
echo "Server check failed with: $CHECK_SERVER"
exit 1
fi
2 changes: 1 addition & 1 deletion stable/redis-ha/templates/redis-ha-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ spec:
{{- end }}
livenessProbe:
exec:
command: [ "sh", "/probes/readiness.sh", "{{ .Values.redis.port }}"]
command: [ "sh", "/probes/liveness.sh", "{{ .Values.redis.port }}"]
initialDelaySeconds: 15
periodSeconds: 5
readinessProbe:
Expand Down

0 comments on commit 96dbfd3

Please sign in to comment.