Merge "[COMMON] Add custom certs into AAF truststore"
[oom.git] / kubernetes / common / mariadb-galera / templates / statefulset.yaml
index 0dcb8e3..7b0d90a 100644 (file)
@@ -94,12 +94,18 @@ spec:
                   fieldPath: metadata.name
             - name: BITNAMI_DEBUG
               value: {{ ternary "true" "false" .Values.debug | quote }}
-            - name: DB_INIT_SLEEP_TIME
+            - name: MARIADB_INIT_SLEEP_TIME
               value: {{ .Values.init_sleep_time | quote }}
             - name: MARIADB_GALERA_CLUSTER_NAME
               value: {{ .Values.galera.name | quote }}
             - name: MARIADB_GALERA_CLUSTER_ADDRESS
               value: "gcomm://{{ template "common.name" . }}-headless.{{ include "common.namespace" . }}.svc.{{ .Values.global.clusterDomain }}"
+            # Bitnami init script don't behave well in dual stack env.
+            # set it here as long as https://github.com/bitnami/charts/issues/4077 is not solved.
+            - name: MARIADB_GALERA_NODE_ADDRESS
+              valueFrom:
+                fieldRef:
+                  fieldPath: status.podIP
             - name: MARIADB_ROOT_USER
               value: {{ .Values.rootUser.user | quote }}
             - name: MARIADB_ROOT_PASSWORD
@@ -123,7 +129,7 @@ spec:
           livenessProbe:
             exec:
               command:
-                - bash
+                - sh
                 - -ec
                 - |
                   exec mysqladmin status -u$MARIADB_ROOT_USER -p$MARIADB_ROOT_PASSWORD
@@ -137,7 +143,7 @@ spec:
           readinessProbe:
             exec:
               command:
-                - bash
+                - sh
                 - -ec
                 - |
                   exec mysqladmin status -u$MARIADB_ROOT_USER -p$MARIADB_ROOT_PASSWORD
@@ -147,6 +153,20 @@ spec:
             successThreshold: {{ .Values.readinessProbe.successThreshold }}
             failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
           {{- end }}
+          {{- if .Values.startupProbe.enabled }}
+          startupProbe:
+            exec:
+              command:
+                - sh
+                - -ec
+                - |
+                  exec mysqladmin status -u$MARIADB_ROOT_USER -p$MARIADB_ROOT_PASSWORD
+            initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
+            periodSeconds: {{ .Values.startupProbe.periodSeconds }}
+            timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }}
+            successThreshold: {{ .Values.startupProbe.successThreshold }}
+            failureThreshold: {{ .Values.startupProbe.failureThreshold }}
+          {{- end }}
           resources: {{ include "common.resources" . | nindent 12 }}
           volumeMounts:
             - name: previous-boot