diff --git a/charts/dependency/mariadb/Chart.yaml b/charts/dependency/mariadb/Chart.yaml index 717c35e47b4..c04505bb638 100644 --- a/charts/dependency/mariadb/Chart.yaml +++ b/charts/dependency/mariadb/Chart.yaml @@ -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 diff --git a/charts/dependency/mariadb/values.yaml b/charts/dependency/mariadb/values.yaml index 862546d8344..deb5a241f41 100644 --- a/charts/dependency/mariadb/values.yaml +++ b/charts/dependency/mariadb/values.yaml @@ -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" diff --git a/charts/library/common/Chart.yaml b/charts/library/common/Chart.yaml index d1c4ae6bd0a..0127605eace 100644 --- a/charts/library/common/Chart.yaml +++ b/charts/library/common/Chart.yaml @@ -15,4 +15,4 @@ maintainers: name: common sources: null type: library -version: 9.1.8 +version: 9.1.9 diff --git a/charts/library/common/templates/lib/controller/_pod.tpl b/charts/library/common/templates/lib/controller/_pod.tpl index 586fc912831..e78b361c34a 100644 --- a/charts/library/common/templates/lib/controller/_pod.tpl +++ b/charts/library/common/templates/lib/controller/_pod.tpl @@ -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 }} diff --git a/charts/library/common/templates/lib/dependencies/_mariadbInit.tpl b/charts/library/common/templates/lib/dependencies/_mariadbInit.tpl new file mode 100644 index 00000000000..e47739ec37e --- /dev/null +++ b/charts/library/common/templates/lib/dependencies/_mariadbInit.tpl @@ -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 -}}