From ef33ca90f7ecdb00987266f232c68be4afb90e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bojan=20=C4=8Cekrli=C4=87?= Date: Tue, 18 May 2021 23:50:57 +0200 Subject: [PATCH] New: Make it posssible to configure helm probes --- helm/mail/templates/statefulset.yaml | 29 +++---------------------- helm/mail/values.yaml | 32 +++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 27 deletions(-) diff --git a/helm/mail/templates/statefulset.yaml b/helm/mail/templates/statefulset.yaml index afb67bd..e7e6808 100644 --- a/helm/mail/templates/statefulset.yaml +++ b/helm/mail/templates/statefulset.yaml @@ -62,32 +62,9 @@ spec: - name: smtp containerPort: 587 protocol: TCP - readinessProbe: - initialDelaySeconds: 5 - periodSeconds: 60 - exec: - command: - - sh - - -c - - 'printf "EHLO healthcheck\n" | nc 127.0.0.1 587 | grep -qE "^220.*ESMTP Postfix"' - livenessProbe: - initialDelaySeconds: 5 - periodSeconds: 5 - failureThreshold: 1 - exec: - command: - - sh - - -c - - 'ps axf | fgrep -v grep | fgrep -q "{supervisord}" && ps axf | fgrep -v grep | fgrep -q "/usr/libexec/postfix/master"' - startupProbe: - initialDelaySeconds: 2 - periodSeconds: 5 - failureThreshold: 12 - exec: - command: - - sh - - -c - - 'ps axf | fgrep -v grep | fgrep -q "{supervisord}" && ps axf | fgrep -v grep | fgrep -q "{postfix-script}" && ps axf | fgrep -v grep | fgrep -q "{opendkim.sh}"' + readinessProbe: {{- toYaml .Values.readinessProbe | nindent 12 }} + livenessProbe: {{- toYaml .Values.livenessProbe | nindent 12 }} + startupProbe: {{- toYaml .Values.startupProbe | nindent 12 }} envFrom: - configMapRef: name: {{ $fullName | quote }} diff --git a/helm/mail/values.yaml b/helm/mail/values.yaml index 9e4be96..3929087 100644 --- a/helm/mail/values.yaml +++ b/helm/mail/values.yaml @@ -70,7 +70,8 @@ container: # Define data which should be stored in a Secret # (and shared with the pod as environment variables) -# secret: {} +# secret: +# hello: world config: general: {} @@ -103,3 +104,32 @@ persistence: existingClaim: "" size: 1Gi storageClass: "" + + +readinessProbe: + initialDelaySeconds: 30 + periodSeconds: 60 + failureThreshold: 2 + exec: + command: + - sh + - -c + - 'printf "EHLO healthcheck\n" | nc 127.0.0.1 587 | grep -qE "^220.*ESMTP Postfix"' +livenessProbe: + initialDelaySeconds: 5 + periodSeconds: 5 + failureThreshold: 2 + exec: + command: + - sh + - -c + - 'ps axf | fgrep -v grep | fgrep -q "{supervisord}" && ps axf | fgrep -v grep | fgrep -q "/usr/libexec/postfix/master"' +startupProbe: + initialDelaySeconds: 5 + periodSeconds: 5 + failureThreshold: 12 + exec: + command: + - sh + - -c + - 'ps axf | fgrep -v grep | fgrep -q "{supervisord}" && ps axf | fgrep -v grep | fgrep -q "{postfix-script}" && ps axf | fgrep -v grep | fgrep -q "{opendkim.sh}"'