init job fix -4
This commit is contained in:
parent
73eb35db36
commit
3b1918978a
@ -129,5 +129,5 @@ Get database secret name
|
|||||||
Create JDBC connection string
|
Create JDBC connection string
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "hades.jdbcUrl" -}}
|
{{- define "hades.jdbcUrl" -}}
|
||||||
{{- printf "jdbc:mysql://%s:%s/%s?useSSL=false&serverTimezone=UTC&characterEncoding=utf8" (include "hades.databaseHost" .) (include "hades.databasePort" .) (include "hades.databaseName" .) }}
|
{{- printf "jdbc:mysql://%s:%s/%s?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true&characterEncoding=latin1" (include "hades.databaseHost" .) (include "hades.databasePort" .) (include "hades.databaseName" .) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
47
hades/templates/configmap-hibernate.yaml
Normal file
47
hades/templates/configmap-hibernate.yaml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{{- if .Values.config.enabled }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "hades.fullname" . }}-hibernate
|
||||||
|
labels:
|
||||||
|
{{- include "hades.labels" . | nindent 4 }}
|
||||||
|
data:
|
||||||
|
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 }}
|
||||||
@ -20,6 +20,7 @@ spec:
|
|||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||||
|
checksum/hibernate: {{ include (print $.Template.BasePath "/configmap-hibernate.yaml") . | sha256sum }}
|
||||||
{{- with .Values.podAnnotations }}
|
{{- with .Values.podAnnotations }}
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@ -148,6 +149,10 @@ spec:
|
|||||||
- name: config
|
- name: config
|
||||||
mountPath: /etc/onlinesales/config/hades
|
mountPath: /etc/onlinesales/config/hades
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
- name: hibernate-config
|
||||||
|
mountPath: /etc/onlinesales/config/hades/hibernate.cfg.xml
|
||||||
|
subPath: hibernate.cfg.xml
|
||||||
|
readOnly: true
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.allhosts.enabled }}
|
{{- if .Values.allhosts.enabled }}
|
||||||
- name: allhosts
|
- name: allhosts
|
||||||
@ -162,6 +167,9 @@ spec:
|
|||||||
- name: config
|
- name: config
|
||||||
configMap:
|
configMap:
|
||||||
name: {{ include "hades.fullname" . }}-config
|
name: {{ include "hades.fullname" . }}-config
|
||||||
|
- name: hibernate-config
|
||||||
|
configMap:
|
||||||
|
name: {{ include "hades.fullname" . }}-hibernate
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.allhosts.enabled }}
|
{{- if .Values.allhosts.enabled }}
|
||||||
- name: allhosts
|
- name: allhosts
|
||||||
|
|||||||
@ -290,40 +290,7 @@ config:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hibernate.cfg.xml: |
|
# Hibernate configuration options (hibernate.cfg.xml is now generated dynamically)
|
||||||
<?xml version='1.0' encoding='utf-8'?>
|
hibernate:
|
||||||
<!DOCTYPE hibernate-configuration PUBLIC
|
connectionPoolSize: 10
|
||||||
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
|
showSql: "true"
|
||||||
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
|
|
||||||
<hibernate-configuration>
|
|
||||||
<session-factory>
|
|
||||||
<!-- Database connection settings -->
|
|
||||||
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
|
|
||||||
<property name="connection.url">jdbc:mysql://hades-mysql-db-service:3306/hades_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true&characterEncoding=latin1</property>
|
|
||||||
<property name="connection.username">hades_user</property>
|
|
||||||
<property name="connection.password">local-hades-pass</property>
|
|
||||||
|
|
||||||
<!-- JDBC connection pool settings -->
|
|
||||||
<property name="connection.pool_size">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">true</property>
|
|
||||||
<property name="connection.isolation">2</property>
|
|
||||||
<property name="connection.autocommit">true</property>
|
|
||||||
<property name="use_keying_service">false</property>
|
|
||||||
|
|
||||||
<property name="c3p0.acquire_increment">10</property>
|
|
||||||
<property name="c3p0.idle_test_period">60</property> <!-- seconds -->
|
|
||||||
<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> <!-- seconds -->
|
|
||||||
<property name="hibernate.c3p0.maxConnectionAge">3600</property>
|
|
||||||
<property name="hibernate.c3p0.preferredTestQuery">select 1;</property>
|
|
||||||
</session-factory>
|
|
||||||
</hibernate-configuration>
|
|
||||||
|
|||||||
@ -182,6 +182,12 @@ config:
|
|||||||
allhosts:
|
allhosts:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
# Hibernate configuration options
|
||||||
|
# The hibernate.cfg.xml is generated dynamically from these values
|
||||||
|
hibernate:
|
||||||
|
connectionPoolSize: 10
|
||||||
|
showSql: "true"
|
||||||
|
|
||||||
nodeSelector: {}
|
nodeSelector: {}
|
||||||
|
|
||||||
tolerations: []
|
tolerations: []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user