Skip to content

Commit

Permalink
Specify db to use to create the temporal DBs (#2)
Browse files Browse the repository at this point in the history
If you want the helm chart to create the temporal and visibility databases
the sql tool will use postgres or defaultdb as a database to connect to.
This commit adds the ability to specify which is this default db for the sql tool
to connect to first.
  • Loading branch information
atanasovskib authored Jan 16, 2025
1 parent 42afaad commit 054acd8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion charts/temporal/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ dependencies:
repository: https://grafana.github.io/helm-charts
version: 8.0.2
condition: grafana.enabled

2 changes: 1 addition & 1 deletion charts/temporal/templates/server-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
{{- if eq $driver "cassandra" }}
command: ['temporal-cassandra-tool', 'create', '-k', '{{ $storeConfig.cassandra.keyspace }}', '--replication-factor', '{{ $storeConfig.cassandra.replicationFactor }}']
{{- else if eq $driver "sql" }}
command: ['temporal-sql-tool', 'create-database']
command: ['temporal-sql-tool', 'create-database', '--defaultdb','{{ $storeConfig.sql.defaultdb }}']
{{- end }}
env:
{{- include "temporal.admintools-env" (list $ $store) | nindent 12 }}
Expand Down
9 changes: 6 additions & 3 deletions charts/temporal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,11 @@ server:
consistency: "local_quorum"
serialConsistency: "local_serial"
sql:
driver: "mysql"
host: "mysql"
port: 3306
driver: "postgres12"
host: "postgres"
port: 5432
# database used to connect to so the temporal database can be created
defaultdb: "postgres"
database: "temporal"
user: "temporal"
password: "temporal"
Expand Down Expand Up @@ -186,6 +188,7 @@ server:
driver: "mysql"
host: "mysql"
port: 3306
defaultdb: "postgres"
database: "temporal_visibility"
user: "temporal"
password: "temporal"
Expand Down
4 changes: 4 additions & 0 deletions charts/temporal/values/values.postgresql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ server:
driver: "postgres12"
host: _HOST_
port: 5432
# database used to connect to so the temporal database can be created
defaultdb: postgres
database: temporal
user: _USER_
password: _PASSWORD_
Expand Down Expand Up @@ -36,6 +38,8 @@ server:
driver: "postgres12"
host: _HOST_
port: 5432
# database used to connect to so the visibility database can be created
defaultdb: postgres
database: temporal_visibility
user: _USER_
password: _PASSWORD_
Expand Down

0 comments on commit 054acd8

Please sign in to comment.