fix: redis: move probes scripts from tpl file into configmap
Signed-off-by: François Blondel <francois.blondel@diva-e.com>
This commit is contained in:
parent
f97095050f
commit
5ac4e4f1ed
2 changed files with 22 additions and 31 deletions
|
@ -1,29 +0,0 @@
|
||||||
{{/* vim: set filetype=mustache: */}}
|
|
||||||
|
|
||||||
{{- define "redis_liveness.sh" }}
|
|
||||||
response=$(
|
|
||||||
redis-cli \
|
|
||||||
-h localhost \
|
|
||||||
-p {{ .Values.redis.containerPorts.redis }} \
|
|
||||||
ping
|
|
||||||
)
|
|
||||||
if [ "$response" != "PONG" ] && [ "${response:0:7}" != "LOADING" ] ; then
|
|
||||||
echo "$response"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "response=$response"
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- define "redis_readiness.sh" }}
|
|
||||||
response=$(
|
|
||||||
redis-cli \
|
|
||||||
-h localhost \
|
|
||||||
-p {{ .Values.redis.containerPorts.redis }} \
|
|
||||||
ping
|
|
||||||
)
|
|
||||||
if [ "$response" != "PONG" ] ; then
|
|
||||||
echo "$response"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "response=$response"
|
|
||||||
{{- end }}
|
|
|
@ -9,7 +9,27 @@ metadata:
|
||||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }}
|
{{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }}
|
||||||
data:
|
data:
|
||||||
redis_liveness.sh: |
|
redis_liveness.sh: |
|
||||||
{{- include "redis_liveness.sh" . }}
|
response=$(
|
||||||
|
redis-cli \
|
||||||
|
-h localhost \
|
||||||
|
-p {{ .Values.redis.containerPorts.redis }} \
|
||||||
|
ping
|
||||||
|
)
|
||||||
|
if [ "$response" != "PONG" ] && [ "${response:0:7}" != "LOADING" ] ; then
|
||||||
|
echo "$response"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "response=$response"
|
||||||
redis_readiness.sh: |
|
redis_readiness.sh: |
|
||||||
{{- include "redis_readiness.sh" . }}
|
response=$(
|
||||||
|
redis-cli \
|
||||||
|
-h localhost \
|
||||||
|
-p {{ .Values.redis.containerPorts.redis }} \
|
||||||
|
ping
|
||||||
|
)
|
||||||
|
if [ "$response" != "PONG" ] ; then
|
||||||
|
echo "$response"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "response=$response"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Reference in a new issue