From 55a98f4567fda16ee1e87d0190d30c4558716f86 Mon Sep 17 00:00:00 2001 From: Victor Pugin Date: Wed, 20 Sep 2023 11:52:12 +0200 Subject: [PATCH 1/2] add support for custom deployment annotations --- chart/elastalert2/README.md | 1 + chart/elastalert2/templates/deployment.yaml | 5 ++++- chart/elastalert2/values.yaml | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/chart/elastalert2/README.md b/chart/elastalert2/README.md index 04b32071..86b9f7a8 100644 --- a/chart/elastalert2/README.md +++ b/chart/elastalert2/README.md @@ -52,6 +52,7 @@ The command removes all the Kubernetes components associated with the chart and | `image.tag` | docker image tag | 2.13.2 | | `image.pullPolicy` | image pull policy | IfNotPresent | | `image.pullSecret` | image pull secret | "" | +| `deploymentAnnotations` | Annotations to be added to deployment | {} | | `podAnnotations` | Annotations to be added to pods | {} | | `podSecurityContext` | Configurable podSecurityContext for pod execution environment | {"runAsUser": 1000, "runAsGroup": 1000, "fsGroup": 1000} | | `securityContext` | Allows you to set the securityContext for the container | {"runAsNonRoot": true, "runAsUser": 1000} | diff --git a/chart/elastalert2/templates/deployment.yaml b/chart/elastalert2/templates/deployment.yaml index 12640a5f..e04f7c8c 100644 --- a/chart/elastalert2/templates/deployment.yaml +++ b/chart/elastalert2/templates/deployment.yaml @@ -5,11 +5,14 @@ metadata: labels: {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + {{- end }} app: {{ template "elastalert.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if .Values.deploymentAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.deploymentAnnotations "context" $ ) | nindent 4 }} + {{- end }} spec: selector: matchLabels: diff --git a/chart/elastalert2/values.yaml b/chart/elastalert2/values.yaml index f17f91eb..e836c07f 100644 --- a/chart/elastalert2/values.yaml +++ b/chart/elastalert2/values.yaml @@ -55,6 +55,9 @@ image: resources: {} +# Annotations to be added to deployment +deploymentAnnotations: {} + # Annotations to be added to pods podAnnotations: {} From bcc7606fc79befd93f89db11f7242b8523cf636e Mon Sep 17 00:00:00 2001 From: Victor Pugin Date: Wed, 20 Sep 2023 12:03:33 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fbce3e5..9bb2a8b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ## New features - 'summary_table_type' property now supports 'html' format for aggregation tables - [#1260](https://github.com/jertel/elastalert2/pull/1260) - @jertel +- [Helm] Add support for custom deployment annotations - [#1271](https://github.com/jertel/elastalert2/pull/1271) - @victorpugin ## Other changes - [Helm] Expose minReadySeconds parameter to assist in detecting failed deployments - [#1243](https://github.com/jertel/elastalert2/pull/1243) - @alexku7