From 3ee4a6ac9204582c500732998925a45015c4f544 Mon Sep 17 00:00:00 2001 From: WrenIX Date: Mon, 12 Aug 2024 13:47:10 +0200 Subject: [PATCH] fix(stalwart-mail): update AppVersion v0.9.1 (and scrape metrics) --- stalwart-mail/Chart.yaml | 4 +-- stalwart-mail/README.adoc | 39 +++++++++++++++++++-- stalwart-mail/templates/servicemonitor.yaml | 25 +++++++++++++ stalwart-mail/values.yaml | 13 +++++++ 4 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 stalwart-mail/templates/servicemonitor.yaml diff --git a/stalwart-mail/Chart.yaml b/stalwart-mail/Chart.yaml index 988da0d..1d53947 100644 --- a/stalwart-mail/Chart.yaml +++ b/stalwart-mail/Chart.yaml @@ -3,9 +3,9 @@ name: stalwart-mail description: Helm Chart for Stalwart Mail Server - Secure & Modern All-in-One Mail Server (IMAP, JMAP, SMTP) icon: https://stalw.art/home/apple-touch-icon.png type: application -version: 0.0.12 +version: 0.0.13 # renovate: image=docker.io/stalwartlabs/mail-server -appVersion: "0.8.5" +appVersion: "0.9.1" maintainers: - name: WrenIX url: https://wrenix.eu diff --git a/stalwart-mail/README.adoc b/stalwart-mail/README.adoc index 06bc038..a4fd58c 100644 --- a/stalwart-mail/README.adoc +++ b/stalwart-mail/README.adoc @@ -2,9 +2,9 @@ = stalwart-mail -image::https://img.shields.io/badge/Version-0.0.12-informational?style=flat-square[Version: 0.0.12] +image::https://img.shields.io/badge/Version-0.0.13-informational?style=flat-square[Version: 0.0.13] image::https://img.shields.io/badge/Version-application-informational?style=flat-square[Type: application] -image::https://img.shields.io/badge/AppVersion-0.8.5-informational?style=flat-square[AppVersion: 0.8.5] +image::https://img.shields.io/badge/AppVersion-0.9.1-informational?style=flat-square[AppVersion: 0.9.1] == Maintainers .Maintainers @@ -159,6 +159,21 @@ helm uninstall stalwart-mail-release | `"internal"` | +| config.metrics.prometheus.auth.secret +| string +| `"%{env:METRICS_SECRET}%"` +| + +| config.metrics.prometheus.auth.username +| string +| `"%{env:METRICS_USERNAME}%"` +| + +| config.metrics.prometheus.enable +| bool +| `true` +| + | config.server.listener.http.bind[0] | string | `"[::]:80"` @@ -519,6 +534,16 @@ helm uninstall stalwart-mail-release | `{}` | +| prometheus.servicemonitor.enabled +| bool +| `false` +| + +| prometheus.servicemonitor.labels +| object +| `{}` +| + | readinessProbe.httpGet.path | string | `"/healthz/ready"` @@ -539,6 +564,16 @@ helm uninstall stalwart-mail-release | `{}` | +| secrets.env.METRICS_SECRET +| string +| `"scrape_metrics_password"` +| + +| secrets.env.METRICS_USERNAME +| string +| `"scrape_metrics_user"` +| + | securityContext | object | `{}` diff --git a/stalwart-mail/templates/servicemonitor.yaml b/stalwart-mail/templates/servicemonitor.yaml new file mode 100644 index 0000000..ef8058f --- /dev/null +++ b/stalwart-mail/templates/servicemonitor.yaml @@ -0,0 +1,25 @@ +{{- if and .Values.config.metrics.prometheus.enable .Values.prometheus.servicemonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "stalwart-mail.fullname" . }} + labels: + {{- include "stalwart-mail.labels" . | nindent 4 }} + {{- with .Values.prometheus.servicemonitor.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + selector: + matchLabels: + {{- include "stalwart-mail.selectorLabels" . | nindent 6 }} + endpoints: + - port: http + path: "/metrics/prometheus" + basicAuth: + username: + name: {{ include "stalwart-mail.fullname" . }}-env + key: METRICS_USERNAME + password: + name: {{ include "stalwart-mail.fullname" . }}-env + key: METRICS_SECRET +{{- end }} diff --git a/stalwart-mail/values.yaml b/stalwart-mail/values.yaml index 9932801..30ec5c9 100644 --- a/stalwart-mail/values.yaml +++ b/stalwart-mail/values.yaml @@ -117,12 +117,20 @@ config: # -- password for fallback authentfication (use env for store in secrets of kubernetes) # @section -- Authentification secret: "%{env:FALLBACK_ADMIN_SECRET}%" + metrics: + prometheus: + enable: true + auth: + username: "%{env:METRICS_USERNAME}%" + secret: "%{env:METRICS_SECRET}%" secrets: env: # -- password for fallback authentfication (env) # @section -- Authentification FALLBACK_ADMIN_SECRET: supersecret + METRICS_USERNAME: "scrape_metrics_user" + METRICS_SECRET: "scrape_metrics_password" serviceAccount: # Specifies whether a service account should be created @@ -239,6 +247,11 @@ certificate: dnsNames: - "chart-example.local" +prometheus: + servicemonitor: + enabled: false + labels: {} + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little