[stable/redis-ha] Fixes #17752 (#17780)

Signed-off-by: f-ld <f.ld@free.fr>
This commit is contained in:
fabien
2019-10-29 06:46:43 -07:00
committed by Kubernetes Prow Robot
parent ccab3aa382
commit de4d0fca3a
3 changed files with 21 additions and 3 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ keywords:
- redis
- keyvalue
- database
version: 3.9.2
version: 3.9.3
appVersion: 5.0.5
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
+8 -2
View File
@@ -189,7 +189,7 @@
option tcp-check
tcp-check connect
{{- if .Values.auth }}
tcp-check send AUTH\ {{ .Values.redisPassword }}\r\n
tcp-check send AUTH\ REPLACE_AUTH_SECRET\r\n
tcp-check expect string +OK
{{- end }}
tcp-check send PING\r\n
@@ -208,7 +208,7 @@
option tcp-check
tcp-check connect
{{- if .Values.auth }}
tcp-check send AUTH\ {{ .Values.redisPassword }}\r\n
tcp-check send AUTH\ REPLACE_AUTH_SECRET\r\n
tcp-check expect string +OK
{{- end }}
tcp-check send PING\r\n
@@ -241,5 +241,11 @@
exit 1
fi
sed -i "s/REPLACE_ANNOUNCE{{ $i }}/$ANNOUNCE_IP{{ $i }}/" "$HAPROXY_CONF"
if [ "${AUTH:-}" ]; then
echo "Setting auth values"
ESCAPED_AUTH=$(echo "$AUTH" | sed -e 's/[\/&]/\\&/g');
sed -i "s/REPLACE_AUTH_SECRET/${ESCAPED_AUTH}/" "$HAPROXY_CONF"
fi
{{- end }}
{{- end }}
@@ -47,6 +47,18 @@ spec:
- sh
args:
- /readonly/haproxy_init.sh
{{- if .Values.auth }}
env:
- name: AUTH
valueFrom:
secretKeyRef:
{{- if .Values.existingSecret }}
name: {{ .Values.existingSecret }}
{{- else }}
name: {{ template "redis-ha.fullname" . }}
{{- end }}
key: {{ .Values.authKey }}
{{- end }}
volumeMounts:
- name: config-volume
mountPath: /readonly