init job with root user

This commit is contained in:
Vaibhav Pathak 2026-02-25 10:37:50 +05:30
parent 5762ee7f6a
commit cb1f6fca69
3 changed files with 22 additions and 2 deletions

View File

@ -59,3 +59,21 @@ Database JDBC URL
{{- define "property-settings-svc-v2-chart.databaseJdbcUrl" -}}
{{- printf "jdbc:mysql://%s:%s/%s?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&" (include "property-settings-svc-v2-chart.databaseHost" .) (include "property-settings-svc-v2-chart.databasePort" .) (include "property-settings-svc-v2-chart.databaseName" .) -}}
{{- end -}}
{{/*
Database root username (for init job)
*/}}
{{- define "property-settings-svc-v2-chart.databaseRootUsername" -}}
root
{{- end -}}
{{/*
Database root password (for init job)
*/}}
{{- define "property-settings-svc-v2-chart.databaseRootPassword" -}}
{{- if .Values.mysql.enabled -}}
{{- .Values.mysql.mysqlRootPassword -}}
{{- else -}}
{{- .Values.externalDatabase.rootPassword | default .Values.externalDatabase.password -}}
{{- end -}}
{{- end -}}

View File

@ -51,9 +51,9 @@ spec:
- name: MYSQL_DATABASE
value: {{ include "property-settings-svc-v2-chart.databaseName" . | quote }}
- name: MYSQL_USER
value: {{ include "property-settings-svc-v2-chart.databaseUsername" . | quote }}
value: {{ include "property-settings-svc-v2-chart.databaseRootUsername" . | quote }}
- name: MYSQL_PWD
value: {{ include "property-settings-svc-v2-chart.databasePassword" . | quote }}
value: {{ include "property-settings-svc-v2-chart.databaseRootPassword" . | quote }}
command:
- /bin/bash
- -c

View File

@ -229,6 +229,8 @@ externalDatabase:
database: "property_settings_db_v2"
username: "propertysettings"
password: "changeme"
# Root password for database initialization (defaults to password if not set)
rootPassword: "changeme"
# Application Configuration Files
# These values are used to generate the ConfigMap mounted at /etc/onlinesales/config/propertySettingsSvcV2