Skip to content

Commit d1a2f9b

Browse files
committed
Add custom MySQL DSN query params feature
- Introduce `DB_CUSTOM_PARAMS` in `configmap.yaml`. - Enhance `DB_URL` in `deployments.yaml` to include custom params. - Define `mysql.extraParams` in `values.yaml` for configuration. Signed-off-by: kahirokunn <okinakahiro@gmail.com>
1 parent 72dbacc commit d1a2f9b

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

charts/devlake/templates/configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ data:
3232
DB_CHARSET: "utf8mb4"
3333
DB_PARSE_TIME: "True"
3434
DB_LOCATION: "{{ .Values.commonEnvs.TZ }}"
35+
DB_CUSTOM_PARAMS: "{{ .Values.mysql.extraParams }}"
3536
{{- end }}

charts/devlake/templates/deployments.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ spec:
199199
value: "{{ .Values.lake.port }}"
200200
{{- if (eq .Values.option.database "mysql") }}
201201
- name: DB_URL
202-
value: "mysql://$(MYSQL_USER):$(MYSQL_PASSWORD)@$(MYSQL_SERVER):$(MYSQL_PORT)/$(MYSQL_DATABASE)?charset=$(DB_CHARSET)&parseTime=$(DB_PARSE_TIME)&loc=$(DB_LOCATION)"
202+
value: "mysql://$(MYSQL_USER):$(MYSQL_PASSWORD)@$(MYSQL_SERVER):$(MYSQL_PORT)/$(MYSQL_DATABASE)?charset=$(DB_CHARSET)&parseTime=$(DB_PARSE_TIME)&loc=$(DB_LOCATION){{ .Values.mysql.extraParams }}"
203203
{{- end }}
204204
{{- range $key1, $value1 := .Values.lake.envs }}
205205
- name: "{{ tpl $key1 $ }}"

charts/devlake/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ mysql:
4747
# the database for devlake
4848
database: lake
4949

50+
# extra MySQL DSN query params appended to DB_URL.
51+
# Note: include a leading '&' yourself. Empty string means no change.
52+
# example: "&tls=skip-verify" or "&tls=skip-verify&autocommit=true"
53+
extraParams: ""
54+
5055
# root password for mysql, only used when use_external=false
5156
rootPassword: admin
5257

0 commit comments

Comments
 (0)