Files
charts/bitnami/redis-cluster/templates/scripts-configmap.yaml
T
faed1b1c27 [bitnami/redis-cluster] Add TLS support for cluster (#2760)
* [bitnami/redis-cluster] Add TLS support to Redis-Cluster

Signed-off-by: joancafom <jcarmona@bitnami.com>

* [bitnami/redis-cluster] Update components versions

Signed-off-by: Bitnami Containers <containers@bitnami.com>

Co-authored-by: Carlos Rodríguez Hernández <carlosrh@vmware.com>
Co-authored-by: Bitnami Containers <containers@bitnami.com>
2020-06-10 14:13:23 +02:00

59 lines
1.6 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "redis-cluster.fullname" . }}-scripts
labels: {{- include "redis-cluster.labels" . | nindent 4 }}
data:
ping_readiness_local.sh: |-
{{- if .Values.usePasswordFile }}
password_aux=`cat ${REDIS_PASSWORD_FILE}`
export REDISCLI_AUTH=$password_aux
{{- else }}
export REDISCLI_AUTH=$REDIS_PASSWORD
{{- end }}
response=$(
timeout -s 9 $1 \
redis-cli \
-h localhost \
{{- if .Values.tls.enabled }}
-p $REDIS_TLS_PORT \
--tls \
--cert {{ template "redis-cluster.tlsCert" . }} \
--key {{ template "redis-cluster.tlsCertKey" . }} \
--cacert {{ template "redis-cluster.tlsCACert" . }} \
{{- else }}
-p $REDIS_PORT \
{{- end }}
ping
)
if [ "$response" != "PONG" ]; then
echo "$response"
exit 1
fi
ping_liveness_local.sh: |-
{{- if .Values.usePasswordFile }}
password_aux=`cat ${REDIS_PASSWORD_FILE}`
export REDISCLI_AUTH=$password_aux
{{- else }}
export REDISCLI_AUTH=$REDIS_PASSWORD
{{- end }}
response=$(
timeout -s 9 $1 \
redis-cli \
-h localhost \
{{- if .Values.tls.enabled }}
-p $REDIS_TLS_PORT \
--tls \
--cert {{ template "redis-cluster.tlsCert" . }} \
--key {{ template "redis-cluster.tlsCertKey" . }} \
--cacert {{ template "redis-cluster.tlsCACert" . }} \
{{- else }}
-p $REDIS_PORT \
{{- end }}
ping
)
if [ "$response" != "PONG" ] && [ "$response" != "LOADING Redis is loading the dataset in memory" ]; then
echo "$response"
exit 1
fi