Skip to content

Commit f797ff7

Browse files
committed
add an initial fix for the redis password not being set in the connection string
1 parent 4938df9 commit f797ff7

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ Generate list of nodes for Redis with Sentinel connection string, based on numbe
114114
{{- end -}}
115115
{{- end -}}
116116

117+
{{- define "stackstorm-ha.redis-password" -}}
118+
{{- if not .Values.redis.sentinel.enabled }}
119+
{{- fail "value for redis.sentinel.enabled MUST be true" }}
120+
{{- end }}
121+
{{- if not (empty .Values.redis.password)}}:{{ .Values.redis.password }}@{{- end }}
122+
{{- end -}}
123+
117124
{{/*
118125
Reduce duplication of the st2.*.conf volume details
119126
*/}}

templates/configmaps_st2-conf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ data:
1818
ssh_key_file = {{ tpl .Values.st2.system_user.ssh_key_file . }}
1919
{{- if index .Values "redis" "enabled" }}
2020
[coordination]
21-
url = redis://{{ template "stackstorm-ha.redis-nodes" $ }}
21+
url = redis://{{ template "stackstorm-ha.redis-password" $ }}{{ template "stackstorm-ha.redis-nodes" $ }}
2222
{{- end }}
2323
{{- if index .Values "rabbitmq" "enabled" }}
2424
[messaging]

values.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ st2:
6767
config: |
6868
[api]
6969
allow_origin = '*'
70-
70+
7171
#Override Definitions can be added here.
7272
#https://docs.stackstorm.com/latest/packs.html#overriding-pack-defaults
7373
overrides: {}
@@ -1052,10 +1052,15 @@ redis:
10521052
# https://github.com/bitnami/charts/tree/master/bitnami/redis#master-slave-with-sentinel
10531053
sentinel:
10541054
enabled: true
1055+
# DO NOT SET sentinel.usePassword, the tooz driver under the hood cannot connect to a password protected sentinel
1056+
# however it can connect to a password protected redis that is being managed by sentinel
1057+
# usePassword: false
10551058
# Enable or disable static sentinel IDs for each replicas
10561059
# If disabled each sentinel will generate a random id at startup
10571060
# If enabled, each replicas will have a constant ID on each start-up
10581061
staticID: true
1062+
# if redis.usePassword is true, you can set the password here
1063+
# password: mysupersecretpassword
10591064
networkPolicy:
10601065
enabled: false
10611066
usePassword: false

0 commit comments

Comments
 (0)