File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313
1414# Dependency directories (remove the comment below to include it)
1515# vendor/
16+
17+ * .tgz
Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ The ui endpoint
104104{{- end -}}
105105{{- end -}}
106106
107+ {{- define " devlake.mysql.configmap" -}}
108+ {{ include " devlake.fullname" . }}-config
109+ {{- end -}}
110+
107111{{- define " devlake.ui.auth.secret" -}}
108112{{- if .Values.ui.basicAuth.secretName -}}
109113{{- .Values.ui.basicAuth.secretName -}}
@@ -165,16 +169,6 @@ The database port
165169{{- end }}
166170
167171
168- {{/*
169- The database url
170- */ }}
171- {{- define " database.url" -}}
172- {{- if eq .Values.option.database " mysql" -}}
173- mysql://{{ .Values.mysql.username }}:{{ .Values.mysql.password }}@{{ include " mysql.server" . }}:{{ include " mysql.port" . }}/{{ .Values.mysql.database }}?charset= utf8mb4&parseTime= True&loc= {{ .Values.commonEnvs.TZ }}
174- {{- end }}
175- {{- end }}
176-
177-
178172{{/*
179173The probe for check database connection
180174*/ }}
Original file line number Diff line number Diff line change 1+ #
2+ # Licensed to the Apache Software Foundation (ASF) under one or more
3+ # contributor license agreements. See the NOTICE file distributed with
4+ # this work for additional information regarding copyright ownership.
5+ # The ASF licenses this file to You under the Apache License, Version 2.0
6+ # (the "License"); you may not use this file except in compliance with
7+ # the License. You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing, software
12+ # distributed under the License is distributed on an "AS IS" BASIS,
13+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ # See the License for the specific language governing permissions and
15+ # limitations under the License.
16+ #
17+ ---
18+ apiVersion : v1
19+ kind : ConfigMap
20+ metadata :
21+ name : {{ include "devlake.mysql.configmap" . }}
22+ labels :
23+ {{- include "devlake.labels" . | nindent 4 }}
24+ data :
25+ # Database connection configuration (non-sensitive)
26+ {{- if (eq .Values.option.database "mysql") }}
27+ MYSQL_USER : " {{ .Values.mysql.username }}"
28+ MYSQL_DATABASE : " {{ .Values.mysql.database }}"
29+ MYSQL_URL : " {{ include " mysql.server" . }}:{{ include "mysql.port" . }}"
30+ MYSQL_SERVER : " {{ include " mysql.server" . }}"
31+ MYSQL_PORT : " {{ include " mysql.port" . }}"
32+ DB_CHARSET : " utf8mb4"
33+ DB_PARSE_TIME : " True"
34+ DB_LOCATION : " {{ .Values.commonEnvs.TZ }}"
35+ {{- end }}
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ spec:
162162 {{- with .Values.lake.containerSecurityContext }}
163163 securityContext :
164164 {{- toYaml . | nindent 12 }}
165- {{- end }}
165+ {{- end }}
166166 containers :
167167 - name : lake
168168 {{- if .Values.lake.image.tag }}
@@ -182,6 +182,8 @@ spec:
182182 {{- toYaml . | nindent 12 }}
183183 {{- end }}
184184 envFrom :
185+ - configMapRef :
186+ name : {{ include "devlake.mysql.configmap" . }}
185187 - secretRef :
186188 name : {{ include "devlake.mysql.secret" . }}
187189 - secretRef :
@@ -193,6 +195,10 @@ spec:
193195 env :
194196 - name : PORT
195197 value : " {{ .Values.lake.port }}"
198+ {{- if (eq .Values.option.database "mysql") }}
199+ - name : DB_URL
200+ value : " mysql://$(MYSQL_USER):$(MYSQL_PASSWORD)@$(MYSQL_SERVER):$(MYSQL_PORT)/$(MYSQL_DATABASE)?charset=$(DB_CHARSET)&parseTime=$(DB_PARSE_TIME)&loc=$(DB_LOCATION)"
201+ {{- end }}
196202 {{- range $key1, $value1 := .Values.lake.envs }}
197203 - name : " {{ tpl $key1 $ }}"
198204 value : " {{ tpl (print $value1) $ }}"
Original file line number Diff line number Diff line change @@ -22,17 +22,10 @@ metadata:
2222 name : {{ include "devlake.mysql.secret" . }}
2323stringData :
2424{{- if (eq .Values.option.database "mysql") }}
25- MYSQL_USER : " {{ .Values.mysql.username }}"
2625 MYSQL_PASSWORD : " {{ .Values.mysql.password }}"
27- MYSQL_DATABASE : " {{ .Values.mysql.database }}"
2826 MYSQL_ROOT_PASSWORD : " {{ .Values.mysql.rootPassword }}"
29- DB_URL : " {{ include " database.url" . }}"
30- MYSQL_URL : " {{ include " mysql.server" . }}:{{ include "mysql.port" . }}"
3127#{{- else if (eq .Values.option.database "pgsql")}}
32- # POSTGRES_USER: "{{ .Values.pgsql.username }}"
3328# POSTGRES_PASSWORD: "{{ .Values.pgsql.password }}"
34- # POSTGRES_DB: "{{ .Values.pgsql.database }}"
35- # DB_URL: "{{ include "database.url" . }}"
3629{{- end }}
3730{{- end }}
3831
Original file line number Diff line number Diff line change 9090 {{- toYaml . | nindent 12 }}
9191 {{- end }}
9292 envFrom :
93+ - configMapRef :
94+ name : {{ include "devlake.mysql.configmap" . }}
9395 - secretRef :
9496 name : {{ include "devlake.mysql.secret" . }}
9597 env :
You can’t perform that action at this time.
0 commit comments