Files
auricom-home-cluster/kubernetes/apps/database/redis/app/configmap.yaml
2024-01-25 02:39:33 +01:00

38 lines
913 B
YAML

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.26.1-standalone-strict/configmap-v1.json
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-healthcheck
labels:
app.kubernetes.io/name: redis
data:
ping_readiness.sh: |-
#!/bin/sh
export REDISCLI_AUTH="$REDIS_PASSWORD"
response=$(
timeout -s 3 $1 \
redis-cli \
-h localhost \
-p $REDIS_PORT \
ping
)
if [ "$response" != "PONG" ]; then
echo "$response"
exit 1
fi
ping_liveness.sh: |-
#!/bin/sh
export REDISCLI_AUTH="$REDIS_PASSWORD"
response=$(
timeout -s 3 $1 \
redis-cli \
-h localhost \
-p $REDIS_PORT \
ping
)
if [ "$response" != "PONG" ] && [ "$response" != "LOADING Redis is loading the dataset in memory" ]; then
echo "$response"
exit 1
fi