fix(mariadb): Wait for init (#2226)
* fix(mariadb): Wait for init * check until.. * also on standalone app * use correct host on init container * single space
This commit is contained in:
parent
5d19df6663
commit
f2aa31d365
|
@ -24,7 +24,7 @@ sources:
|
|||
- https://github.com/prometheus/mysqld_exporter
|
||||
- https://mariadb.org
|
||||
type: application
|
||||
version: 2.0.7
|
||||
version: 2.0.8
|
||||
annotations:
|
||||
truecharts.org/catagories: |
|
||||
- database
|
||||
|
|
|
@ -62,7 +62,7 @@ probes:
|
|||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- mysqladmin status -uroot -p"${MARIADB_ROOT_PASSWORD}"
|
||||
- "until /opt/bitnami/scripts/mariadb/healthcheck.sh; do sleep 2; done"
|
||||
|
||||
# -- Redainess probe configuration
|
||||
# @default -- See below
|
||||
|
@ -79,7 +79,7 @@ probes:
|
|||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- mysqladmin status -uroot -p"${MARIADB_ROOT_PASSWORD}"
|
||||
- "until /opt/bitnami/scripts/mariadb/healthcheck.sh; do sleep 2; done"
|
||||
# -- Startup probe configuration
|
||||
# @default -- See below
|
||||
startup:
|
||||
|
@ -94,7 +94,7 @@ probes:
|
|||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- mysqladmin status -uroot -p"${MARIADB_ROOT_PASSWORD}"
|
||||
- "until /opt/bitnami/scripts/mariadb/healthcheck.sh; do sleep 2; done"
|
||||
|
||||
mariadbPassword: "testpass"
|
||||
mariadbUsername: "test"
|
||||
|
|
|
@ -15,4 +15,4 @@ maintainers:
|
|||
name: common
|
||||
sources: null
|
||||
type: library
|
||||
version: 9.1.8
|
||||
version: 9.1.9
|
||||
|
|
|
@ -53,6 +53,7 @@ initContainers:
|
|||
{{- include "common.controller.autopermissions" . | nindent 2 }}
|
||||
{{- include "common.controller.hostpatch" . | nindent 2 }}
|
||||
{{- include "common.dependencies.postgresql.init" . | nindent 2 }}
|
||||
{{- include "common.dependencies.mariadb.init" . | nindent 2 }}
|
||||
{{- if .Release.IsInstall }}
|
||||
{{- if .Values.installContainers }}
|
||||
{{- $installContainers := list }}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
{{/*
|
||||
This template ensures pods with postgresql dependency have a delayed start
|
||||
*/}}
|
||||
{{- define "common.dependencies.mariadb.init" -}}
|
||||
{{- $pghost := printf "%v-%v" .Release.Name "mariadb" }}
|
||||
{{- if .Values.mariadb.enabled }}
|
||||
- name: mariadb-init
|
||||
image: "{{ .Values.mariadblImage.repository}}:{{ .Values.mariadblImage.tag }}"
|
||||
env:
|
||||
- name: MARIADB_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mariadbcreds
|
||||
key: plainhost
|
||||
- name: MARIADB_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mariadbcreds
|
||||
key: mariadb-root-password
|
||||
securityContext:
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
resources:
|
||||
{{- with .Values.resources }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
command:
|
||||
- "bash"
|
||||
- "-ec"
|
||||
- "until mysqladmin -uroot -h"${MARIADB_HOST}" -p"${MARIADB_ROOT_PASSWORD}" ping && mysqladmin -uroot -h"${MARIADB_HOST}" -p"${MARIADB_ROOT_PASSWORD}" status; do sleep 2; done"
|
||||
imagePullPolicy: IfNotPresent
|
||||
{{- end }}
|
||||
{{- end -}}
|
Loading…
Reference in New Issue