feat(argo-cd): Add Probes for redis (#2400)

* feat(argo-cd): Add Probes for redis

Signed-off-by: François Blondel <francois.blondel@diva-e.com>

* fix: redis: move probes scripts from tpl file into configmap

Signed-off-by: François Blondel <francois.blondel@diva-e.com>

* Version Bump

Signed-off-by: François Blondel <francois.blondel@diva-e.com>

* feat: set Redis probes optionnal and disabled by default

Signed-off-by: François Blondel <francois.blondel@diva-e.com>

---------

Signed-off-by: François Blondel <francois.blondel@diva-e.com>
Co-authored-by: François Blondel <francois.blondel@diva-e.com>
This commit is contained in:
François Blondel 2024-02-06 14:11:23 +01:00 committed by GitHub
parent 4a50afcc77
commit 5da598289d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 176 additions and 5 deletions

View file

@ -0,0 +1,35 @@
{{- $redisHa := index .Values "redis-ha" -}}
{{- if and .Values.redis.enabled (not $redisHa.enabled) -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "argo-cd.redis.fullname" . }}-health-configmap
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }}
data:
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: |
response=$(
redis-cli \
-h localhost \
-p {{ .Values.redis.containerPorts.redis }} \
ping
)
if [ "$response" != "PONG" ] ; then
echo "$response"
exit 1
fi
echo "response=$response"
{{- end }}