Alertmanager can be configured to send notifications to different targets, Slack, Email, PagerDuty etc.
Use the below steps to configure AWS SES as SMTP server to send E-Mails from alertmanager
-
The from address should be already verified in AWS SES to send E-Mails from that address
-
Check and confirm if you have secret named "alertmanager-main" in monitoring namespace
-
Create a file called alertmanager.yaml with below contents, modify as needed
"global":
"resolve_timeout": "5m"
"receivers":
- "name": "org-prometheus-notify"
"email_configs":
- "to": "[email protected]"
"from": "[email protected]"
"smarthost": "email-smtp.us-east-1.amazonaws.com:587"
# The catch here is aws access key and secret won't work here, we should create SMTP credentials from AWS Console
"auth_username": "<SMTP_USERNAME>"
"auth_password": "<SMTP_PASSWORD>"
"require_tls": true
"route":
"group_by":
- "job"
"group_interval": "5m"
"group_wait": "30s"
"receiver": "org-prometheus-notify"
"repeat_interval": "12h"
"routes":
- "match":
"alertname": "Watchdog"
"receiver": "org-prometheus-notify"
- Create alertmanager-secret-k8s.yaml with below contents
apiVersion: v1
data:
alertmanager.yaml: ALERTMANAGER_CONFIG
kind: Secret
metadata:
name: alertmanager-main
namespace: monitoring
type: Opaque
- Execute the below command to update the secret by using the contents in alertmanager.yaml
sed "s/ALERTMANAGER_CONFIG/$(cat alertmanager.yaml | base64 -w0)/g" alertmanager-secret-k8s.yaml | kubectl apply -f -
- Alertmanager pods will reload the configuration change by itself and should start sending E-Mails.