[COMMON][CASSANDRA] Use Startup probes 25/121125/1
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>
Wed, 5 May 2021 08:47:58 +0000 (10:47 +0200)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Thu, 6 May 2021 06:22:05 +0000 (08:22 +0200)
Instead of long initial delay on readiness and liveness probes, use
startup probes and be more aggressive on readiness and liveness.

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

kubernetes/common/cassandra/templates/statefulset.yaml
kubernetes/common/cassandra/values.yaml

index 953c89d..3553cd4 100644 (file)
@@ -71,6 +71,17 @@ spec:
           timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
           successThreshold: {{ .Values.readiness.successThreshold }}
           failureThreshold: {{ .Values.readiness.failureThreshold }}
+        startupProbe:
+          exec:
+            command:
+            - /bin/bash
+            - -c
+            - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }'
+          initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }}
+          periodSeconds: {{ .Values.startup.periodSeconds }}
+          timeoutSeconds: {{ .Values.startup.timeoutSeconds }}
+          successThreshold: {{ .Values.startup.successThreshold }}
+          failureThreshold: {{ .Values.startup.failureThreshold }}
         env:
           {{- $seed_size := default 1 .Values.replicaCount | int -}}
           {{- $global := . }}
index c3d22ce..5a50d8e 100644 (file)
@@ -54,8 +54,8 @@ affinity: {}
 
 # probe configuration parameters
 liveness:
-  initialDelaySeconds: 60
-  periodSeconds: 20
+  initialDelaySeconds: 1
+  periodSeconds: 10
   timeoutSeconds: 10
   successThreshold: 1
   failureThreshold: 3
@@ -64,12 +64,19 @@ liveness:
   enabled: true
 
 readiness:
-  initialDelaySeconds: 120
-  periodSeconds: 20
+  initialDelaySeconds: 1
+  periodSeconds: 10
   timeoutSeconds: 10
   successThreshold: 1
   failureThreshold: 3
 
+startup:
+  initialDelaySeconds: 10
+  periodSeconds: 10
+  timeoutSeconds: 10
+  successThreshold: 1
+  failureThreshold: 90
+
 service:
   name: cassandra
   headless: