mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[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:
committed by
Kubernetes Prow Robot
parent
4cbc02a65f
commit
f95b8b589b
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user