From f8fa7c2717eabbaa0699ce79e7b8e55dfc60fc22 Mon Sep 17 00:00:00 2001
From: Arie Peterson <arie@greenhost.nl>
Date: Wed, 1 Sep 2021 16:38:30 +0200
Subject: [PATCH] Add startupProbe for onlyoffice

---
 templates/onlyoffice-deployment.yaml | 13 +++++++++++--
 values.yaml                          | 21 ++++++++++++++-------
 2 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/templates/onlyoffice-deployment.yaml b/templates/onlyoffice-deployment.yaml
index 42e9f08e..e306be33 100644
--- a/templates/onlyoffice-deployment.yaml
+++ b/templates/onlyoffice-deployment.yaml
@@ -32,7 +32,6 @@ spec:
           imagePullPolicy: {{ .Values.onlyoffice.image.pullPolicy }}
           {{- if .Values.onlyoffice.livenessProbe.enabled }}
           livenessProbe:
-            failureThreshold: 3
             httpGet:
               path: /welcome
               port: http
@@ -45,7 +44,6 @@ spec:
           {{- end }}
           {{- if .Values.onlyoffice.readinessProbe.enabled }}
           readinessProbe:
-            failureThreshold: 3
             httpGet:
               path: /welcome
               port: http
@@ -56,6 +54,17 @@ spec:
             successThreshold: {{ .Values.onlyoffice.readinessProbe.successThreshold }}
             failureThreshold: {{ .Values.onlyoffice.readinessProbe.failureThreshold }}
           {{- end }}
+          {{- if .Values.onlyoffice.startupProbe.enabled }}
+          startupProbe:
+            httpGet:
+              path: /welcome
+              port: http
+              scheme: HTTP
+            periodSeconds: {{ .Values.onlyoffice.startupProbe.periodSeconds }}
+            timeoutSeconds: {{ .Values.onlyoffice.startupProbe.timeoutSeconds }}
+            successThreshold: {{ .Values.onlyoffice.startupProbe.successThreshold }}
+            failureThreshold: {{ .Values.onlyoffice.startupProbe.failureThreshold }}
+          {{- end }}
           env:
             - name: AMQP_URI
               value: "amqp://user:{{ .Values.rabbitmq.rabbitmq.password }}@{{ .Release.Name }}-rabbitmq:{{ .Values.rabbitmq.service.port }}"
diff --git a/values.yaml b/values.yaml
index 15780ed8..9203afd6 100644
--- a/values.yaml
+++ b/values.yaml
@@ -134,19 +134,26 @@ onlyoffice:
 
   livenessProbe:
     enabled: true
-    initialDelaySeconds: 120
-    timeoutSeconds: 5
-    periodSeconds: 10
+    initialDelaySeconds: 0
+    timeoutSeconds: 2
+    periodSeconds: 30
     successThreshold: 1
-    failureThreshold: 20
+    failureThreshold: 2
 
   readinessProbe:
     enabled: true
-    initialDelaySeconds: 30
+    initialDelaySeconds: 0
+    timeoutSeconds: 2
+    periodSeconds: 30
+    successThreshold: 1
+    failureThreshold: 2
+
+  startupProbe:
+    enabled: true
     timeoutSeconds: 2
-    periodSeconds: 20
+    periodSeconds: 5
     successThreshold: 1
-    failureThreshold: 20
+    failureThreshold: 120
 
 redis:
   master:
-- 
GitLab