51 lines
2.5 KiB
YAML
51 lines
2.5 KiB
YAML
{{- if .Values.config.enabled }}
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: {{ include "hades.fullname" . }}-config
|
|
labels:
|
|
{{- include "hades.labels" . | nindent 4 }}
|
|
data:
|
|
{{- with .Values.config.files }}
|
|
{{- toYaml . | nindent 2 }}
|
|
{{- end }}
|
|
hibernate.cfg.xml: |
|
|
<?xml version='1.0' encoding='utf-8'?>
|
|
<!DOCTYPE hibernate-configuration PUBLIC
|
|
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
|
|
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
|
|
<hibernate-configuration>
|
|
<session-factory>
|
|
<!-- Database connection settings (dynamically resolved) -->
|
|
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
|
|
<property name="connection.url">{{ include "hades.jdbcUrl" . | replace "&" "&" }}</property>
|
|
<property name="connection.username">{{ include "hades.databaseUsername" . }}</property>
|
|
<property name="connection.password">{{ .Values.database.password | default .Values.mysql.mysqlPassword | default "local-mysql-pass" }}</property>
|
|
|
|
<!-- JDBC connection pool settings -->
|
|
<property name="connection.pool_size">{{ .Values.hibernate.connectionPoolSize | default 10 }}</property>
|
|
|
|
<!-- SQL dialect -->
|
|
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
|
|
<property name="current_session_context_class">thread</property>
|
|
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
|
|
|
|
<!-- Echo all executed SQL to stdout -->
|
|
<property name="show_sql">{{ .Values.hibernate.showSql | default "true" }}</property>
|
|
<property name="connection.isolation">2</property>
|
|
<property name="connection.autocommit">true</property>
|
|
<property name="use_keying_service">false</property>
|
|
|
|
<!-- C3P0 connection pool settings -->
|
|
<property name="c3p0.acquire_increment">10</property>
|
|
<property name="c3p0.idle_test_period">60</property>
|
|
<property name="c3p0.max_size">50</property>
|
|
<property name="c3p0.max_statements">0</property>
|
|
<property name="c3p0.min_size">10</property>
|
|
<property name="c3p0.timeout">65</property>
|
|
<property name="hibernate.c3p0.maxConnectionAge">3600</property>
|
|
<property name="hibernate.c3p0.preferredTestQuery">select 1;</property>
|
|
</session-factory>
|
|
</hibernate-configuration>
|
|
{{- end }}
|