[COMMON][MARIADB] Use Startup probes 95/121095/7
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>
Wed, 5 May 2021 07:20:18 +0000 (09:20 +0200)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Sat, 8 May 2021 21:45:08 +0000 (21:45 +0000)
Instead of long initial delay on readiness and liveness probes, use
startup probes and be more aggressive on readiness and liveness.

Issue-ID: OOM-2740
Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Change-Id: I86015a4a0c4ab313929c5bd103dedced1df88ec3

kubernetes/common/mariadb-galera/templates/statefulset.yaml
kubernetes/common/mariadb-galera/values.yaml

index bde971f..7b0d90a 100644 (file)
@@ -129,7 +129,7 @@ spec:
           livenessProbe:
             exec:
               command:
-                - bash
+                - sh
                 - -ec
                 - |
                   exec mysqladmin status -u$MARIADB_ROOT_USER -p$MARIADB_ROOT_PASSWORD
@@ -143,7 +143,7 @@ spec:
           readinessProbe:
             exec:
               command:
-                - bash
+                - sh
                 - -ec
                 - |
                   exec mysqladmin status -u$MARIADB_ROOT_USER -p$MARIADB_ROOT_PASSWORD
@@ -153,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
index 79b1cb2..b313c1e 100644 (file)
@@ -497,20 +497,29 @@ resources:
 ##
 livenessProbe:
   enabled: true
-  ## Initializing the database could take some time
-  ##
-  initialDelaySeconds: 150
+  initialDelaySeconds: 1
   periodSeconds: 10
   timeoutSeconds: 1
   successThreshold: 1
   failureThreshold: 3
 readinessProbe:
   enabled: true
-  initialDelaySeconds: 60
+  initialDelaySeconds: 1
   periodSeconds: 10
   timeoutSeconds: 1
   successThreshold: 1
   failureThreshold: 3
+startupProbe:
+  ## Initializing the database could take some time
+  ##
+  enabled: true
+  initialDelaySeconds: 10
+  periodSeconds: 10
+  timeoutSeconds: 1
+  successThreshold: 1
+  # will wait up for initialDelaySeconds + failureThreshold*periodSeconds before
+  # stating startup wasn't good (910s per default)
+  failureThreshold: 90
 
 ## Pod disruption budget configuration
 ##