changes for mysql
This commit is contained in:
parent
ebf174d3d3
commit
8769e826e1
@ -32,18 +32,24 @@ spec:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
{{- if .Values.externalDatabase.host }}
|
||||
initContainers:
|
||||
- name: wait-for-mysql
|
||||
image: busybox:1.36
|
||||
- name: wait-for-mysql-init
|
||||
image: mysql:5.7
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
echo "Waiting for MySQL at {{ .Values.externalDatabase.host }}:{{ .Values.externalDatabase.port }}..."
|
||||
until nc -z {{ .Values.externalDatabase.host }} {{ .Values.externalDatabase.port }}; do
|
||||
echo "MySQL not ready, waiting..."
|
||||
echo "Waiting for MySQL to be fully initialized..."
|
||||
until mysql -h {{ .Values.externalDatabase.host }} -P {{ .Values.externalDatabase.port }} -u {{ .Values.externalDatabase.username }} -p${MYSQL_PASSWORD} -e "SELECT 1 FROM GROUP_DETAILS LIMIT 1" {{ .Values.externalDatabase.database }} 2>/dev/null; do
|
||||
echo "Waiting for database tables to be created..."
|
||||
sleep 5
|
||||
done
|
||||
echo "MySQL is available!"
|
||||
echo "MySQL is fully initialized!"
|
||||
env:
|
||||
- name: MYSQL_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "schedulerservice.fullname" . }}-db-config
|
||||
key: password
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
|
||||
@ -7,6 +7,7 @@ metadata:
|
||||
{{- include "schedulerservice.labels" . | nindent 4 }}
|
||||
type: Opaque
|
||||
stringData:
|
||||
password: {{ .Values.externalDatabase.password | quote }}
|
||||
hibernate.cfg.xml: |
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE hibernate-configuration PUBLIC
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user