@@ -19,6 +19,12 @@ credential:
1919 serviceRef :
2020 name : {{ printf "%s-master" (include "common.names.fullname" .) }}
2121 jsonpath : ' { .spec.ports[?(@.name=="tcp-redis")].port }'
22+
23+ - name : REDISPORT
24+ valueFrom :
25+ serviceRef :
26+ name : {{ template "common.names.fullname" . }}
27+ jsonpath : ' { .spec.ports[?(@.name=="tcp-redis")].port }'
2228 {{- end }}
2329
2430 {{- if and (eq .Values.architecture "replication") (not .Values.sentinel.enabled) }}
@@ -43,14 +49,6 @@ credential:
4349 jsonpath : ' { .spec.ports[?(@.name=="tcp-redis")].port }'
4450 {{- end }}
4551
46- {{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
47- - name : REDIS_PASSWORD
48- valueFrom :
49- secretKeyRef :
50- name : {{ template "common.names.fullname" . }}
51- jsonpath : ' { .data.redis-password }'
52- {{- end }}
53-
5452 {{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }}
5553 {{ if (eq .Values.sentinel.service.type "LoadBalancer") }}
5654 - name : EXTERNAL_SENTINELHOST
@@ -71,10 +69,20 @@ credential:
7169 serviceRef :
7270 name : {{ template "common.names.fullname" . }}
7371 jsonpath : ' { .spec.ports[?(@.name=="tcp-sentinel")].port }'
72+ {{- end }}
7473
75- - name : REDISPORT
74+ {{- if and .Values.auth.enabled (not .Values.auth.existingSecret) }}
75+ - name : REDIS_PASSWORD
7676 valueFrom :
77- serviceRef :
77+ secretKeyRef :
7878 name : {{ template "common.names.fullname" . }}
79- jsonpath : ' { .spec.ports[?(@.name=="tcp-redis")].port }'
79+ jsonpath : ' { .data.redis-password }'
80+ {{- end }}
81+
82+ {{- if and .Values.auth.enabled .Values.auth.sentinel (not .Values.auth.existingSecret) }}
83+ - name : REDIS_SENTINEL_PASSWORD
84+ valueFrom :
85+ secretKeyRef :
86+ name : {{ template "common.names.fullname" . }}
87+ jsonpath : ' { .data.redis-password }'
8088 {{- end }}
0 commit comments