diff --git a/stable/redis-ha/Chart.yaml b/stable/redis-ha/Chart.yaml index 531013acdb..77e5f0566d 100644 --- a/stable/redis-ha/Chart.yaml +++ b/stable/redis-ha/Chart.yaml @@ -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 diff --git a/stable/redis-ha/templates/_configs.tpl b/stable/redis-ha/templates/_configs.tpl index e38dab0697..5a590da517 100644 --- a/stable/redis-ha/templates/_configs.tpl +++ b/stable/redis-ha/templates/_configs.tpl @@ -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 }} diff --git a/stable/redis-ha/templates/redis-haproxy-deployment.yaml b/stable/redis-ha/templates/redis-haproxy-deployment.yaml index 4715f761b6..0b3d63a73f 100644 --- a/stable/redis-ha/templates/redis-haproxy-deployment.yaml +++ b/stable/redis-ha/templates/redis-haproxy-deployment.yaml @@ -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