From 3370a9d1bcc599878d0cabd3a71500cd7072ec5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bojan=20=C4=8Cekrli=C4=87?= Date: Fri, 27 Oct 2023 16:02:32 +0200 Subject: [PATCH] Fix: helm template fixes for prometheus monitoring --- helm/mail/templates/configmap-metrics.yaml | 6 ++++-- helm/mail/templates/configmap.yaml | 3 --- helm/mail/templates/statefulset.yaml | 7 +++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/helm/mail/templates/configmap-metrics.yaml b/helm/mail/templates/configmap-metrics.yaml index 9a53da3..697e3d5 100644 --- a/helm/mail/templates/configmap-metrics.yaml +++ b/helm/mail/templates/configmap-metrics.yaml @@ -12,8 +12,10 @@ metadata: data: logrotate.conf: | {{- index .Values.metrics.logrotate "logrotate.conf" | nindent 4 }} maillog.conf: | - template(name="metricslog" type="string" string={{ .Values.metrics.path | quote }}) - action(type="omfile" DynaFile="metricslog" template="plain" DirCreateMode="0755" FileCreateMode="0644") + template(name="metricslog" type="string" string={{ .Values.metrics.maillog | quote }}) + if ($syslogfacility == '2') or ($programname == 'postfix') then { + action(type="omfile" DynaFile="metricslog" template="plain" DirCreateMode="0755" FileCreateMode="0644") + } --- apiVersion: v1 kind: ConfigMap diff --git a/helm/mail/templates/configmap.yaml b/helm/mail/templates/configmap.yaml index 064ef2d..3624d2e 100644 --- a/helm/mail/templates/configmap.yaml +++ b/helm/mail/templates/configmap.yaml @@ -13,9 +13,6 @@ data: {{- range $key, $value := .Values.config.postfix }} POSTFIX_{{ $key }}: {{ $value | quote }} {{- end }} - {{- if .Values.metrics.enabled }} - POSTFIX_maillog_file: {{ .Values.metrics.maillog }} - {{- end }} {{- range $key, $value := .Values.config.opendkim }} OPENDKIM_{{ $key }}: {{ $value | quote }} {{- end }} diff --git a/helm/mail/templates/statefulset.yaml b/helm/mail/templates/statefulset.yaml index c16d8ae..7b3ef7e 100644 --- a/helm/mail/templates/statefulset.yaml +++ b/helm/mail/templates/statefulset.yaml @@ -159,6 +159,13 @@ spec: - name: {{ $fullName | quote }} mountPath: {{ regexFind "^/?.*/" .Values.metrics.maillog | quote }} subPath: logs + startupProbe: + httpGet: + path: {{ .Values.metrics.path | quote }} + port: {{ .Values.metrics.port }} + initialDelaySeconds: 5 + failureThreshold: 15 + periodSeconds: 2 readinessProbe: httpGet: path: {{ .Values.metrics.path | quote }}