fix: add hades.read/write.hibernate.cfg.xml configurable from values
App expects separate read/write hibernate configs at /etc/onlinesales/db/hadesV2/. Added both files in values-local.yaml with templated DB creds. Changed configmap to use tpl for rendering. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ca2e78769e
commit
7ede16d79e
@ -6,8 +6,9 @@ metadata:
|
||||
labels:
|
||||
{{- include "hades.labels" . | nindent 4 }}
|
||||
data:
|
||||
{{- with .Values.config.files }}
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- range $filename, $content := .Values.config.files }}
|
||||
{{ $filename }}: |
|
||||
{{- tpl $content $ | nindent 4 }}
|
||||
{{- end }}
|
||||
hibernate.cfg.xml: |
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
|
||||
@ -115,8 +115,8 @@ config:
|
||||
{
|
||||
test: {
|
||||
logConfig: "/etc/onlinesales/config/hades/log.cfg",
|
||||
hades_hibernate_config_read: "/etc/onlinesales/config/hades/hibernate.cfg.xml",
|
||||
hades_hibernate_config_write: "/etc/onlinesales/config/hades/hibernate.cfg.xml",
|
||||
hades_hibernate_config_read: "/etc/onlinesales/db/hadesV2/hades.read.hibernate.cfg.xml",
|
||||
hades_hibernate_config_write: "/etc/onlinesales/db/hadesV2/hades.write.hibernate.cfg.xml",
|
||||
rest_accessor_config_file: "/etc/onlinesales/config/hades/restAccessor.cfg",
|
||||
forgot_password_email_config_file: "/etc/onlinesales/config/hades/forgotPasswordEmailSender.cfg",
|
||||
activation_email_config_file: "/etc/onlinesales/config/hades/activationEmailConfigFile.cfg",
|
||||
@ -293,6 +293,74 @@ config:
|
||||
}
|
||||
}
|
||||
|
||||
hades.read.hibernate.cfg.xml: |
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE hibernate-configuration PUBLIC
|
||||
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
|
||||
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
|
||||
<hibernate-configuration>
|
||||
<session-factory>
|
||||
<property name="connection.driver_class">com.mysql.cj.jdbc.Driver</property>
|
||||
<property name="connection.url">jdbc:mysql://{{ include "hades.databaseHost" . }}:{{ include "hades.databasePort" . }}/{{ include "hades.databaseName" . }}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&</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>
|
||||
<property name="connection.pool_size">1</property>
|
||||
<property name="dialect">ai.osmos.dblib.CustomMySQL8DialectUtf8mb4</property>
|
||||
<property name="current_session_context_class">thread</property>
|
||||
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
|
||||
<property name="hibernate.cache.use_second_level_cache">false</property>
|
||||
<property name="show_sql">false</property>
|
||||
<property name="use_keying_service">false</property>
|
||||
<property name="use_credential_store">false</property>
|
||||
<property name="connection.isolation">2</property>
|
||||
<property name="connection.autocommit">true</property>
|
||||
<property name="connection.useUnicode">true</property>
|
||||
<property name="connection.characterEncoding">UTF-8</property>
|
||||
<property name="c3p0.acquire_increment">10</property>
|
||||
<property name="c3p0.idle_test_period">3600</property>
|
||||
<property name="c3p0.max_size">30</property>
|
||||
<property name="c3p0.max_statements">0</property>
|
||||
<property name="c3p0.min_size">10</property>
|
||||
<property name="c3p0.timeout">3605</property>
|
||||
<property name="hibernate.c3p0.preferredTestQuery">select 1;</property>
|
||||
<property name="hibernate.globally_quoted_identifiers">true</property>
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
||||
|
||||
hades.write.hibernate.cfg.xml: |
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE hibernate-configuration PUBLIC
|
||||
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
|
||||
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
|
||||
<hibernate-configuration>
|
||||
<session-factory>
|
||||
<property name="connection.driver_class">com.mysql.cj.jdbc.Driver</property>
|
||||
<property name="connection.url">jdbc:mysql://{{ include "hades.databaseHost" . }}:{{ include "hades.databasePort" . }}/{{ include "hades.databaseName" . }}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&</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>
|
||||
<property name="connection.pool_size">1</property>
|
||||
<property name="dialect">ai.osmos.dblib.CustomMySQL8DialectUtf8mb4</property>
|
||||
<property name="current_session_context_class">thread</property>
|
||||
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
|
||||
<property name="hibernate.cache.use_second_level_cache">false</property>
|
||||
<property name="show_sql">false</property>
|
||||
<property name="use_keying_service">false</property>
|
||||
<property name="use_credential_store">false</property>
|
||||
<property name="connection.isolation">2</property>
|
||||
<property name="connection.autocommit">true</property>
|
||||
<property name="connection.useUnicode">true</property>
|
||||
<property name="connection.characterEncoding">UTF-8</property>
|
||||
<property name="c3p0.acquire_increment">10</property>
|
||||
<property name="c3p0.idle_test_period">3600</property>
|
||||
<property name="c3p0.max_size">30</property>
|
||||
<property name="c3p0.max_statements">0</property>
|
||||
<property name="c3p0.min_size">10</property>
|
||||
<property name="c3p0.timeout">3605</property>
|
||||
<property name="hibernate.c3p0.preferredTestQuery">select 1;</property>
|
||||
<property name="hibernate.globally_quoted_identifiers">true</property>
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
||||
|
||||
# Tomcat writable directories (emptyDir mounts for non-root pods)
|
||||
tomcatWritableDirs:
|
||||
enabled: true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user