blob: 480e9e4dd0d9ec9ad218cf7586f17140f33a5f8e [file] [log] [blame]
apiVersion: v1
kind: ConfigMap
metadata:
namespace: {{.Release.Namespace}}
name: {{ template "common.names.fullname" . }}-configmap
labels:
"app.kubernetes.io/name": '{{ template "common.names.name" . }}'
"app.kubernetes.io/managed-by": "{{ .Release.Service }}"
"app.kubernetes.io/component": "shenyu-configmap"
"app.kubernetes.io/instance": "{{ .Release.Name }}"
data:
application-bootstrap.yml: |-
{{- include "common.tplvalues.render" (dict "value" .Values.applicationConfig.bootstrap "context" $) | nindent 4 }}
application-admin.yml: |-
{{- include "common.tplvalues.render" (dict "value" .Values.applicationConfig.admin "context" $) | nindent 4 }}
{{- if eq .Values.dataSource.active "h2" }}
application-h2.yml: |-
shenyu:
database:
dialect: h2
init_script: "sql-script/h2/schema.sql"
init_enable: {{ .Values.dataSource.initEnabled }}
spring:
datasource:
url: jdbc:h2:mem:~/shenyu;DB_CLOSE_DELAY=-1;MODE=MySQL;
username: {{ .Values.dataSource.h2.username }}
password: {{ .Values.dataSource.h2.password }}
driver-class-name: org.h2.Driver
{{- end }}
{{- if eq .Values.dataSource.active "mysql" }}
application-mysql.yml: |-
shenyu:
database:
dialect: mysql
init_enable: {{ .Values.dataSource.initEnabled }}
spring:
datasource:
url: jdbc:mysql://{{ template "common.names.fullname" . }}-mysql.shenyu.svc.cluster.local:3306/shenyu?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull
username: {{ .Values.dataSource.mysql.username }}
password: {{ required "`dataSource.mysql.password` is required" .Values.dataSource.mysql.password }}
driver-class-name: {{ .Values.dataSource.mysql.driverClass }}
{{- end }}