I'm testing to trigger alert manager to send email but It doesnt work logs that I got from the pod of alert manager
ts=2023-04-18T17:35:15.453Z caller=dispatch.go:352 level=error component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="monitoring/main-rules-alert-config/email/email[0]: notify retry canceled after 4 attempts: establish connection to server: dial tcp 74.125.206.108:587: i/o timeout"and here is the content of my alertmanagerconfig
apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
name: main-rules-alert-config
namespace: monitoring
spec:
route:
receiver: 'email'
repeatInterval: 30m
routes:
- matchers:
- name: alertname
value: HostHighCPULoad
- matchers:
- name: alertname
value: KuberenetesPodCrashLooping
repeatInterval: 30m
receivers:
- name: 'email'
emailConfigs:
- to: "zikou...@gmail.com"
from: "zikou...@gmail.com"
smarthost: 'smtp.gmail.com:587'
authIdentity: "zikou...@gmail.com"
authUsername: "zikou...@gmail.com"
authPassword:
name: gmail-auth
key: password
I created a secret named gmail-auth (in the same namespace as alert) before apply the alert config the secret contain password of my gmail but since 2FA is enabled I put app password in the secret base64 of course but I dont know where is the issue why I dont receive any mail