[stable/redis-ha] Improve liveness probe for large databases (#14999)

* [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 <bashofmann@gmail.com>

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

Signed-off-by: Bastian Hofmann <bashofmann@gmail.com>
This commit is contained in:
Bastian Hofmann
2019-06-26 15:01:20 -07:00
committed by Kubernetes Prow Robot
parent 4cbc02a65f
commit f95b8b589b
3 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -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
@@ -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
@@ -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: