From 2695334503f7681f56620023092a52aa3c293a1a Mon Sep 17 00:00:00 2001 From: lusson Date: Sat, 26 Mar 2022 12:04:54 +0800 Subject: [PATCH 1/5] helm add email secret config --- CHANGELOG.md | 1 + chart/elastalert2/README.md | 2 ++ chart/elastalert2/templates/smtp-auth.yaml | 13 +++++++++++++ chart/elastalert2/values.yaml | 5 +++++ 4 files changed, 21 insertions(+) create mode 100644 chart/elastalert2/templates/smtp-auth.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index fdd1c54c..6167a2ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - [Docs] Update FAQ telegram and Amazon SNS - [#765](https://github.com/jertel/elastalert2/pull/765) - @nsano-rururu - Upgrade Pytest 7.0.1 to 7.1.1 - [#776](https://github.com/jertel/elastalert2/pull/776) - @nsano-rururu - [Email] Fixed schema.yaml setting in email_from_field - [#778](https://github.com/jertel/elastalert2/pull/778) - @nsano-rururu +- [helm] helm add email and password config - [#780](https://github.com/jertel/elastalert2/pull/780) - @lusson-luo # 2.4.0 diff --git a/chart/elastalert2/README.md b/chart/elastalert2/README.md index 93f0b4d4..2739b7a1 100644 --- a/chart/elastalert2/README.md +++ b/chart/elastalert2/README.md @@ -92,3 +92,5 @@ The command removes all the Kubernetes components associated with the chart and | `nodeSelector` | Node selector for deployment | {} | | `affinity` | Affinity specifications for the deployed pod(s) | {} | | `tolerations` | Tolerations for deployment | [] | +| `stmp_auth.from_email` | send email, If the value is not empty, the smtp_auth secret will be created, which configures the information of the sending mailbox | [] | +| `stmp_auth.password` | email password | [] | diff --git a/chart/elastalert2/templates/smtp-auth.yaml b/chart/elastalert2/templates/smtp-auth.yaml new file mode 100644 index 00000000..bbd5cf27 --- /dev/null +++ b/chart/elastalert2/templates/smtp-auth.yaml @@ -0,0 +1,13 @@ +{{- if .Values.stmp_auth }} +apiVersion: v1 +kind: Secret +metadata: + name: elastalert-smtp-auth + labels: + app: elastalert2 +type: kubernetes.io/Opaque +stringData: + smtp_auth.yaml: |- + user: {{ .Values.stmp_auth.from_email }} + password: {{ .Values.stmp_auth.password }} +{{- end}} \ No newline at end of file diff --git a/chart/elastalert2/values.yaml b/chart/elastalert2/values.yaml index c9d3e212..e0c29d2d 100644 --- a/chart/elastalert2/values.yaml +++ b/chart/elastalert2/values.yaml @@ -225,6 +225,11 @@ affinity: {} # effect: "NoSchedule" tolerations: [] +# email send config +# stmp_auth: + # from_email: "" # send email + # password: "" # password + extraVolumes: [] # - name: smtp-auth # secret: From 169ae412a9aaabaffa26dca4f333be399112c741 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Sat, 26 Mar 2022 08:21:47 -0400 Subject: [PATCH 2/5] Fixed typos, change to `username` spelling for consistency --- chart/elastalert2/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chart/elastalert2/README.md b/chart/elastalert2/README.md index 2739b7a1..dd8a5bda 100644 --- a/chart/elastalert2/README.md +++ b/chart/elastalert2/README.md @@ -92,5 +92,5 @@ The command removes all the Kubernetes components associated with the chart and | `nodeSelector` | Node selector for deployment | {} | | `affinity` | Affinity specifications for the deployed pod(s) | {} | | `tolerations` | Tolerations for deployment | [] | -| `stmp_auth.from_email` | send email, If the value is not empty, the smtp_auth secret will be created, which configures the information of the sending mailbox | [] | -| `stmp_auth.password` | email password | [] | +| `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` | From c8a8bd570452a120d7a8c888ad97826ffa526fe3 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Sat, 26 Mar 2022 08:22:43 -0400 Subject: [PATCH 3/5] Fixed typo: stmp -> smtp --- chart/elastalert2/templates/smtp-auth.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chart/elastalert2/templates/smtp-auth.yaml b/chart/elastalert2/templates/smtp-auth.yaml index bbd5cf27..fb7d6561 100644 --- a/chart/elastalert2/templates/smtp-auth.yaml +++ b/chart/elastalert2/templates/smtp-auth.yaml @@ -1,4 +1,4 @@ -{{- if .Values.stmp_auth }} +{{- if .Values.smtp_auth }} apiVersion: v1 kind: Secret metadata: @@ -8,6 +8,6 @@ metadata: type: kubernetes.io/Opaque stringData: smtp_auth.yaml: |- - user: {{ .Values.stmp_auth.from_email }} - password: {{ .Values.stmp_auth.password }} -{{- end}} \ No newline at end of file + user: {{ .Values.smtp_auth.username }} + password: {{ .Values.smtp_auth.password }} +{{- end}} From 2cf7acccfe789ab7a72dd37bd5264d203384d342 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Sat, 26 Mar 2022 08:24:03 -0400 Subject: [PATCH 4/5] Fix typos, clarify comments --- chart/elastalert2/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chart/elastalert2/values.yaml b/chart/elastalert2/values.yaml index e0c29d2d..9187b84b 100644 --- a/chart/elastalert2/values.yaml +++ b/chart/elastalert2/values.yaml @@ -225,10 +225,10 @@ affinity: {} # effect: "NoSchedule" tolerations: [] -# email send config -# stmp_auth: - # from_email: "" # send email - # password: "" # password +# Optional automatic SMTP mail server credential management. +# smtp_auth: +# username: "" +# password: "" extraVolumes: [] # - name: smtp-auth From 0770c34ad21f1176e9e2c914a5f78830731e0d45 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Sat, 26 Mar 2022 08:25:02 -0400 Subject: [PATCH 5/5] Clarified change entry for SMTP credential management --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6167a2ea..bc9c6491 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ - [Docs] Update FAQ telegram and Amazon SNS - [#765](https://github.com/jertel/elastalert2/pull/765) - @nsano-rururu - Upgrade Pytest 7.0.1 to 7.1.1 - [#776](https://github.com/jertel/elastalert2/pull/776) - @nsano-rururu - [Email] Fixed schema.yaml setting in email_from_field - [#778](https://github.com/jertel/elastalert2/pull/778) - @nsano-rururu -- [helm] helm add email and password config - [#780](https://github.com/jertel/elastalert2/pull/780) - @lusson-luo +- [Kubernetes] Add support for automatic SMTP mail server credential management - [#780](https://github.com/jertel/elastalert2/pull/780) - @lusson-luo # 2.4.0