From b3aadb55dab50b3ce0373cbef8c05d157cb14f34 Mon Sep 17 00:00:00 2001 From: aizerin Date: Thu, 16 Jan 2025 15:09:51 +0100 Subject: [PATCH 1/2] added readiness and liveness probe --- CHANGELOG.md | 1 + chart/elastalert2/README.md | 2 ++ chart/elastalert2/templates/deployment.yaml | 8 ++++++++ chart/elastalert2/values.yaml | 6 ++++++ 4 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f85702e..2c65be3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - None ## Other changes +- [Helm] Add optional liveness and readiness probe - [#1604](https://github.com/jertel/elastalert2/pull/1604) - @aizerin - [Docs] Add missing documentation of the `aggregation_alert_time_compared_with_timestamp_field` option. - [#1588](https://github.com/jertel/elastalert2/pull/1588) - @nicolasnovelli - Fix linter error reporting about return type assignation in `elastalert/test_rule.py`. - [#1594](https://github.com/jertel/elastalert2/pull/1594) - @thican - Add support for Kibana 8.17 for Kibana Discover - [#1597](https://github.com/jertel/elastalert2/pull/1597) - @nsano-rururu diff --git a/chart/elastalert2/README.md b/chart/elastalert2/README.md index 5b35e563..6ef5ec0f 100644 --- a/chart/elastalert2/README.md +++ b/chart/elastalert2/README.md @@ -105,6 +105,8 @@ The command removes all the Kubernetes components associated with the chart and | `smtp_auth.username` | Optional SMTP mail server username. If the value is not empty, the smtp_auth secret will be created automatically. | `NULL` | | `smtp_auth.password` | Optional SMTP mail server passwpord. This must be specified if the above field, `smtp_auth.username` is also specified. | `NULL` | | `metrics.enabled` | Enable elastalert prometheus endpoint, add prometheus.io annotations to pod and create a service pointing to the port for prometheus to scrape the metrics | `false` | +| `livenessProbe` | Liveness probe configuration | `enabled: false` | +| `readinessProbe` | Readiness probe configuration | `enabled: false` | | `metrics.prometheusPort` | If "metrics" is set to true, prometheus metrics will be exposed by the pod on this port. | `8080` | | `metrics.prometheusPortName` | Name of the port where metrics are exposed | `http-alt` | | `metrics.prometheusScrapeAnnotations` | If metrics are enabled, annotations to add to the pod for prometheus configuration. prometheus.io/port is also added during the prometheusPort and prometheusPortName values | `{prometheus.io/scrape: "true" prometheus.io/path: "/"}` | diff --git a/chart/elastalert2/templates/deployment.yaml b/chart/elastalert2/templates/deployment.yaml index e04f7c8c..b9d22ae5 100644 --- a/chart/elastalert2/templates/deployment.yaml +++ b/chart/elastalert2/templates/deployment.yaml @@ -98,6 +98,14 @@ spec: {{- end }} resources: {{ toYaml .Values.resources | indent 12 }} +{{- if .Values.livenessProbe.enabled }} + livenessProbe: +{{ toYaml .Values.livenessProbe | indent 10 }} +{{- end }} +{{- if .Values.readinessProbe.enabled }} + readinessProbe: +{{ toYaml .Values.readinessProbe | indent 10 }} +{{- end }} env: {{- if .Values.elasticsearch.credentialsSecret }} {{- if .Values.elasticsearch.credentialsSecretUsernameKey }} diff --git a/chart/elastalert2/values.yaml b/chart/elastalert2/values.yaml index 0cb80419..8f1cf59f 100644 --- a/chart/elastalert2/values.yaml +++ b/chart/elastalert2/values.yaml @@ -219,6 +219,12 @@ rules: {} # pagerduty_service_key: dummy # pagerduty_client_name: ElastAlert Deadman Switch +# Probes configuration +livenessProbe: + enabled: false +readinessProbe: + enabled: false + serviceAccount: # Specifies whether a service account should be created create: true From 55c476a8f483f518a5c6a777a0633870fd62c243 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Thu, 16 Jan 2025 18:23:52 -0500 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c65be3a..52f767db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,9 @@ - None ## New features -- None +- [Helm] Add optional liveness and readiness probe - [#1604](https://github.com/jertel/elastalert2/pull/1604) - @aizerin ## Other changes -- [Helm] Add optional liveness and readiness probe - [#1604](https://github.com/jertel/elastalert2/pull/1604) - @aizerin - [Docs] Add missing documentation of the `aggregation_alert_time_compared_with_timestamp_field` option. - [#1588](https://github.com/jertel/elastalert2/pull/1588) - @nicolasnovelli - Fix linter error reporting about return type assignation in `elastalert/test_rule.py`. - [#1594](https://github.com/jertel/elastalert2/pull/1594) - @thican - Add support for Kibana 8.17 for Kibana Discover - [#1597](https://github.com/jertel/elastalert2/pull/1597) - @nsano-rururu