diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f85702e..52f767db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - None ## New features -- None +- [Helm] Add optional liveness and readiness probe - [#1604](https://github.com/jertel/elastalert2/pull/1604) - @aizerin ## Other changes - [Docs] Add missing documentation of the `aggregation_alert_time_compared_with_timestamp_field` option. - [#1588](https://github.com/jertel/elastalert2/pull/1588) - @nicolasnovelli 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