I have an app deployed using ArgoCD, I want to trigger email notifications once the deployment is successful.
I read about email notifications in argocd docs https://argo-cd.readthedocs.io/en/stable/operator-manual/notifications/ and have performed all the steps mentioned.
I have applied the patch for argocd-notification-cm
kubectl patch cm argocd-notifications-cm -n argocd --type merge -p '{"data": {"service.email": "{ username: test, password: test, host: my-smtp-host, port: my-smtp-port, from: [email protected] }" }}'
Subscribed for notification using,
kubectl patch app app1 -n argocd -p '{"metadata": {"annotations": {"notifications.argoproj.io/subscribe.on-sync-succeeded.email":"[email protected]"}}}' --type merge
In the argocd-notification-cm I have defined as below
data:
service.email: |
host: my-smpt-host
port: my-smpt-port
username: test
password: test
from: [email protected]
and the subscription notification as
annotations:
notifications.argoproj.io/subscribe.on-sync-succeeded.email: [email protected]
However I am not getting any mails and facing below error in the controller.
Failed to notify recipient {email [email protected]} defined in app argocd/app1: notification service 'email' is not supported" app=argocd/app1
I got this working with the changes as below,
Have updated the configMap as
data:
service.email.gmail:
and the subscription annotation as
annotations:
notifications.argoproj.io/subscribe.on-sync-succeeded.gmail
since 'email' is not part of subscription notification service I was facing the error, after updating it to 'gmail' the issue got resolved and emails are getting triggered.