Skip to content

Commit 3563d50

Browse files
committed
fix: Pass MySQL env vars to Grafana for datasource setup
- Introduced `connectionConfigmapName` to optionally override the default ConfigMap name for better configurability. Signed-off-by: kahirokunn <okinakahiro@gmail.com>
1 parent ab5c96d commit 3563d50

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

charts/devlake/templates/_helpers.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,12 @@ The ui endpoint
105105
{{- end -}}
106106

107107
{{- define "devlake.mysql.configmap" -}}
108+
{{- if .Values.option.connectionConfigmapName -}}
109+
{{- .Values.option.connectionConfigmapName -}}
110+
{{- else -}}
108111
{{ include "devlake.fullname" . }}-config
109112
{{- end -}}
113+
{{- end -}}
110114

111115
{{- define "devlake.ui.auth.secret" -}}
112116
{{- if .Values.ui.basicAuth.secretName -}}

charts/devlake/values.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,13 @@ grafana:
169169
server:
170170
serve_from_subpath: "true"
171171
root_url: "%(protocol)s://%(domain)s/grafana"
172-
#the secret name should be as same as .Values.option.connectionSecretName
172+
# the Secret name should be the same as .Values.option.connectionSecretName
173173
envFromSecrets:
174174
- name: "devlake-mysql-auth"
175+
# the ConfigMap name should be the same as .Values.option.connectionConfigmapName
176+
extraEnvFrom:
177+
- configMapRef:
178+
name: "devlake-mysql-auth-config"
175179
#keep grafana timezone same as other pods, which is set by .Values.commonEnvs.TZ
176180
env:
177181
TZ: "UTC"
@@ -436,6 +440,9 @@ option:
436440
database: mysql
437441
# the existing k8s secret name of db connection auth. The secret name should be as same as .Values.grafana.envFromSecret
438442
connectionSecretName: "devlake-mysql-auth"
443+
# Optional: override the ConfigMap name for non-sensitive DB envs used across components
444+
# Default is a fixed name to align references from subcharts
445+
connectionConfigmapName: "devlake-mysql-auth-config"
439446
autoCreateSecret: true
440447
# If true, the chart assembles DB_URL automatically for MySQL. Set to false
441448
# to disable auto-assembly and provide DB_URL yourself via `lake.envs` or

0 commit comments

Comments
 (0)