[COMMON] Mariadb - Move liveness, readiness and startup probe values to values.yaml 43/141643/1
authoraravind.est <aravindhan.a@est.tech>
Fri, 1 Aug 2025 14:39:43 +0000 (15:39 +0100)
committeraravind.est <aravindhan.a@est.tech>
Fri, 1 Aug 2025 14:39:43 +0000 (15:39 +0100)
Mariadb fails to come up in resource constrained environments due to the time taken to complete the db initialization.
Most of the time it is more than the startup probe initial delay. Hence the startup probe is failing and mariadb pod keeps on restarting.
This moves the liveness, readiness, and startup probe values from the template file to the `values.yaml` file for better configuration management.

Issue-ID: OOM-3349
Change-Id: I111a426353e3cb3a68c92e4b468c91508e724a8c
Signed-off-by: aravind.est <aravindhan.a@est.tech>
kubernetes/common/common/templates/_mariadb.tpl
kubernetes/common/mariadb-galera/values.yaml

index f2a4a0c..a9bc046 100644 (file)
@@ -1,6 +1,7 @@
 {{/*
 # Copyright © 2019 Orange
 # Modifications Copyright © 2025 Deutsche Telekom
+# Modifications Copyright © 2025 OpenInfra Foundation Europe.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -376,18 +377,27 @@ spec:
         - bash
         - '-c'
         - mariadb -u root -p"${MARIADB_ROOT_PASSWORD}" -e "SELECT 1;"
-    initialDelaySeconds: 20
-    periodSeconds: 10
-    timeoutSeconds: 5
+    initialDelaySeconds: {{ .Values.mariadbOperator.livenessProbe.initialDelaySeconds | default 20 }}
+    periodSeconds: {{ .Values.mariadbOperator.livenessProbe.periodSeconds | default 10 }}
+    timeoutSeconds: {{ .Values.mariadbOperator.livenessProbe.timeoutSeconds | default 5 }}
   readinessProbe:
     exec:
       command:
         - bash
         - '-c'
         - mariadb -u root -p"${MARIADB_ROOT_PASSWORD}" -e "SELECT 1;"
-    initialDelaySeconds: 20
-    periodSeconds: 10
-    timeoutSeconds: 5
+    initialDelaySeconds: {{ .Values.mariadbOperator.readinessProbe.initialDelaySeconds | default 20 }}
+    periodSeconds: {{ .Values.mariadbOperator.readinessProbe.periodSeconds | default 10 }}
+    timeoutSeconds: {{ .Values.mariadbOperator.readinessProbe.timeoutSeconds | default 5 }}
+  startupProbe:
+    exec:
+      command:
+        - bash
+        - '-c'
+        - mariadb -u root -p"${MARIADB_ROOT_PASSWORD}" -e "SELECT 1;"
+    initialDelaySeconds: {{ .Values.mariadbOperator.startupProbe.initialDelaySeconds | default 20 }}
+    periodSeconds: {{ .Values.mariadbOperator.startupProbe.periodSeconds | default 10 }}
+    timeoutSeconds: {{ .Values.mariadbOperator.startupProbe.timeoutSeconds | default 5 }}
   {{- if default false $dot.Values.global.metrics.enabled }}
   metrics:
     enabled: true
index 1dfeaee..36f47e7 100644 (file)
@@ -2,6 +2,7 @@
 # Copyright © 2018,2021 Bell Canada
 # Copyright © 2019 Samsung Electronics
 # Copyright © 2020 Bitnami, Orange
+# Modifications Copyright © 2025 OpenInfra Foundation Europe.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -61,6 +62,18 @@ mariadbOperator:
   persistence:
     #storageClassName: default
     size: 3Gi
+  livenessProbe:
+    initialDelaySeconds: 20
+    periodSeconds: 10
+    timeoutSeconds: 5
+  readinessProbe:
+    initialDelaySeconds: 20
+    periodSeconds: 10
+    timeoutSeconds: 5
+  startupProbe:
+    initialDelaySeconds: 20
+    periodSeconds: 10
+    timeoutSeconds: 5
   galera:
     enabled: true
     agentImage: mariadb-operator/mariadb-operator