File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ metadata:
99 " helm.sh/hook " : pre-install
1010data :
1111 {{ if eq .Values.global.redisLocation "on-cluster"}}
12+ {{- $redisAddrs := (list ) }}
13+ {{ $redisNodeCount := .Values.replicas | int }}
14+ {{- range $i := until $redisNodeCount }}
15+ {{- $redisAddrs = (append $redisAddrs (printf "drycc-redis-%d.drycc-redis.%s.svc.%s:6379" $i $.Release.Namespace $.Values.global.clusterDomain)) }}
16+ {{- end -}}
17+ addrs : {{ join "," $redisAddrs | b64enc }}
1218 password : {{ randAlphaNum 32 | b64enc }}
1319 {{ else if eq .Values.global.redisLocation "off-cluster"}}
1420 addrs : {{ .Values.addrs | b64enc }}
Original file line number Diff line number Diff line change @@ -39,21 +39,21 @@ spec:
3939 - " 6379"
4040 ports :
4141 - containerPort : 6379
42- volumeMounts :
43- - name : redis-creds
44- mountPath : /var/run/secrets/drycc/redis/creds
4542 {{- if .Values.persistence.enabled }}
43+ env :
44+ - name : DRYCC_REDIS_PASSWORD
45+ valueFrom :
46+ secretKeyRef :
47+ name : redis-creds
48+ key : password
49+ volumeMounts :
4650 - name : redis-data
4751 mountPath : /data
4852 {{- end }}
4953 securityContext :
5054 fsGroup : 1001
5155 runAsGroup : 1001
5256 runAsUser : 1001
53- volumes :
54- - name : redis-creds
55- secret :
56- secretName : redis-creds
5757 {{- if .Values.persistence.enabled }}
5858 volumeClaimTemplates :
5959 - metadata :
Original file line number Diff line number Diff line change @@ -5,12 +5,8 @@ set -eof pipefail
55REDIS_CONFIG_FILE=/etc/redis/redis.conf
66
77# Set password
8- REDIS_PASSWORD_FILE=/var/run/secrets/drycc/redis/creds/password
9- if [ -e $REDIS_PASSWORD_FILE ]; then
10- REDIS_PASSWORD=" $( cat /var/run/secrets/drycc/redis/creds/password) "
11- if [ -n " $REDIS_PASSWORD " ]; then
12- printf " \nrequirepass %s" " $REDIS_PASSWORD " >> $REDIS_CONFIG_FILE
13- fi
8+ if [ -n " $DRYCC_REDIS_PASSWORD " ]; then
9+ printf " \nrequirepass %s" " $DRYCC_REDIS_PASSWORD " >> $REDIS_CONFIG_FILE
1410fi
1511
1612exec redis-server $REDIS_CONFIG_FILE " $@ "
You can’t perform that action at this time.
0 commit comments