-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SMTP config: add global and local password file fields
Add config fields (for both global email config and route-specific email config) that specify path to file containing SMTP password. We don't want the password in the config file itself, and reading the password from a k8s-secret-backed file keeps the password itself "encrypted at rest" in etcd, and cleanly separated from the rest of the AM config. I used the same approach as pull request #2534 "Add support to set the Slack URL in the file" <https://github.com/prometheus/alertmanager/pull/2534/files> in the upstream repo. Signed-off-by: Eric R. Rath <[email protected]>
- Loading branch information
Showing
9 changed files
with
243 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
global: | ||
smtp_smarthost: 'localhost:25' | ||
smtp_from: '[email protected]' | ||
smtp_auth_username: 'alertmanager' | ||
smtp_auth_password: "multiline\nmysecret" | ||
smtp_auth_password_file: "/tmp/global" | ||
smtp_hello: "host.example.org" | ||
route: | ||
group_by: ['alertname', 'cluster', 'service'] | ||
group_wait: 30s | ||
group_interval: 5m | ||
repeat_interval: 3h | ||
receiver: team-X-mails | ||
routes: | ||
- match_re: | ||
service: ^(foo1|foo2|baz)$ | ||
receiver: team-X-mails | ||
routes: | ||
- match: | ||
severity: critical | ||
receiver: team-X-pager | ||
- match: | ||
service: files | ||
receiver: team-Y-mails | ||
routes: | ||
- match: | ||
severity: critical | ||
receiver: team-Y-pager | ||
- match: | ||
service: database | ||
receiver: team-DB-pager | ||
group_by: [alertname, cluster, database] | ||
routes: | ||
- match: | ||
owner2: team-X | ||
receiver: team-X-pager | ||
continue: true | ||
- match: | ||
owner: team-Y | ||
receiver: team-Y-pager | ||
# continue: true | ||
receivers: | ||
- name: 'team-X-mails' | ||
email_configs: | ||
- to: '[email protected]' | ||
- name: 'team-X-pager' | ||
email_configs: | ||
- to: '[email protected]' | ||
pagerduty_configs: | ||
- routing_key: "mysecret" | ||
- name: 'team-Y-mails' | ||
email_configs: | ||
- to: '[email protected]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
global: | ||
smtp_smarthost: 'localhost:25' | ||
smtp_from: '[email protected]' | ||
smtp_auth_username: 'alertmanager' | ||
smtp_hello: "host.example.org" | ||
route: | ||
group_by: ['alertname', 'cluster', 'service'] | ||
group_wait: 30s | ||
group_interval: 5m | ||
repeat_interval: 3h | ||
receiver: team-X-mails | ||
routes: | ||
- match_re: | ||
service: ^(foo1|foo2|baz)$ | ||
receiver: team-X-mails | ||
routes: | ||
- match: | ||
severity: critical | ||
receiver: team-X-pager | ||
- match: | ||
service: files | ||
receiver: team-Y-mails | ||
routes: | ||
- match: | ||
severity: critical | ||
receiver: team-Y-pager | ||
- match: | ||
service: database | ||
receiver: team-DB-pager | ||
group_by: [alertname, cluster, database] | ||
routes: | ||
- match: | ||
owner2: team-X | ||
receiver: team-X-pager | ||
continue: true | ||
- match: | ||
owner: team-Y | ||
receiver: team-Y-pager | ||
receivers: | ||
- name: 'team-X-mails' | ||
email_configs: | ||
- to: '[email protected]' | ||
- name: 'team-X-pager' | ||
email_configs: | ||
- to: '[email protected]' | ||
pagerduty_configs: | ||
- routing_key: "mysecret" | ||
- name: 'team-Y-mails' | ||
email_configs: | ||
- to: '[email protected]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
global: | ||
smtp_smarthost: 'localhost:25' | ||
smtp_from: '[email protected]' | ||
smtp_hello: "host.example.org" | ||
route: | ||
receiver: 'email-notifications' | ||
receivers: | ||
- name: 'email-notifications' | ||
email_configs: | ||
- to: '[email protected]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
global: | ||
smtp_smarthost: 'localhost:25' | ||
smtp_from: '[email protected]' | ||
smtp_auth_username: 'globaluser' | ||
smtp_auth_password_file: '/tmp/globaluserpassword' | ||
smtp_hello: "host.example.org" | ||
route: | ||
receiver: 'email-notifications' | ||
receivers: | ||
- name: 'email-notifications' | ||
email_configs: | ||
# Use global | ||
- to: '[email protected]' | ||
# Override global with other file | ||
- to: '[email protected]' | ||
auth_username: 'localuser1' | ||
auth_password_file: '/tmp/localuser1password' | ||
# Override global with inline password | ||
- to: '[email protected]' | ||
auth_username: 'localuser2' | ||
auth_password: 'mysecret' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters