Skip to content

Commit 806ef07

Browse files
authored
Merge pull request #325 from rebrowning/fix_redis_password_issue
fix for the redis password not being set in the connection string
2 parents c3eff3d + ee30385 commit 806ef07

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Add support for providing custom st2actionrunner-specific docker repository, image name, pull policy, and pull secret via `values.yaml`. (#141) (by @Sheshagiri)
99
* Fix bug that hung an init container when `st2.packs.volumes.enabled` without `st2.packs.volumes.configs`. (#324) (by @rebrowning)
1010
* Add ability to create custom labels for service account.(#327)(by @SuganJoe)
11+
* Fix bug that would not set the appropriate redis connection string when using `redis.password` and `redis.usePassword` (#325) (by @rebrowning)
1112

1213
## v0.100.0
1314
* Switch st2 to `v3.7` as a new default stable version (#274)

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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,10 +1055,15 @@ redis:
10551055
# https://github.com/bitnami/charts/tree/master/bitnami/redis#master-slave-with-sentinel
10561056
sentinel:
10571057
enabled: true
1058+
# DO NOT SET sentinel.usePassword, the tooz driver cannot connect to a password protected sentinel
1059+
# however it can connect to a password protected redis that is being managed by sentinel
1060+
# usePassword: false
10581061
# Enable or disable static sentinel IDs for each replicas
10591062
# If disabled each sentinel will generate a random id at startup
10601063
# If enabled, each replicas will have a constant ID on each start-up
10611064
staticID: true
1065+
# if redis.usePassword is true, you can set the password here
1066+
# password: mysupersecretpassword
10621067
networkPolicy:
10631068
enabled: false
10641069
usePassword: false

0 commit comments

Comments
 (0)