Open rahul799 opened 2 years ago
This has been hitting me as well. I've also noticed that the troubleshooting for the argocd-notification controller deployed as a part of argocd doesn't work.
It appears as if the subcommands aren't there as it tries to start argocd-notifications... help only shows flags
gerald@gerald-laptop:~/playground/spinnaker-cloud-api-pipelines$ kubectl -n argocd exec -it argocd-notifications-controller-56748c87bd-22rcs -- /usr/local/bin/argocd-notifications trigger get
INFO[0000] serving metrics on port 9001
INFO[0000] loading configuration 9001
FATA[0000] listen tcp 0.0.0.0:9001: bind: address already in use
command terminated with exit code 1
There is only one pid in the pod.. argocd-notifications pid 1.
I'm having this problem, too
App Name | Version |
---|---|
Argo CD | v2.3.4+ac8b7df |
Build Date | 2022-05-18T11:41:37Z |
Go Version | go1.17.10 |
Go Compiler | gc |
Platform | linux/amd64 |
ksonnet | v0.13.1 |
jsonnet | v0.18.0 |
kustomize | v4.4.1 2021-11-11T23:36:27Z |
Helm | v3.8.0+gd141386 |
kubectl | v0.23.1 |
k exec -it -n argocd argocd-notifications-controller-7bc66689b7-wtbvf -- /usr/local/bin/argocd-notifications trigger get
INFO[0000] serving metrics on port 9001
INFO[0000] loading configuration 9001
FATA[0000] listen tcp 0.0.0.0:9001: bind: address already in use
command terminated with exit code 1
Hello, any updates or estimates on this fix?
Thanks
This project has moved to the main Argo CD repository which was announced in the README.md.
To test the notification you now have to use following command which will print out details on success or failure.
argocd admin notifications template notify NAME RESOURCE_NAME [flags]
Examples
# Trigger notification using in-cluster config map and secret
argocd admin notifications template notify app-sync-succeeded guestbook --recipient slack:my-slack-channel
# Render notification render generated notification in console
argocd admin notifications template notify app-sync-succeeded guestbook
Find more information in the official documentation:
Also make sure that the template you're defining as NAME
exists in the argocd/argocd-notifications-cm
ConfigMap.
Ok thanks @hebestreit Glad the documentation is updated now ;)
This helped me realize I didn't have any triggers or templates set.
TL;DR I modified my argocd-notifications-cm to be
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
data:
service.slack: |
token: $slack-token
defaultTriggers: |
- on-deployed
trigger.on-deployed: |
- description: Application is synced and healthy. Triggered once per commit.
oncePer: app.status.sync.revision
send:
- app-deployed
when: app.status.operationState.phase in ['Succeeded'] and app.status.health.status == 'Healthy'
template.app-deployed: |
message: |
{{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} is now running new version of deployments manifests.
slack:
attachments: |
[{
"title": "{{ .app.metadata.name}}",
"title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
"color": "#18be52",
"fields": [
{
"title": "Sync Status",
"value": "{{.app.status.sync.status}}",
"short": true
},
{
"title": "Repository",
"value": "{{.app.spec.source.repoURL}}",
"short": true
},
{
"title": "Revision",
"value": "{{.app.status.sync.revision}}",
"short": true
}
{{range $index, $c := .app.status.conditions}}
{{if not $index}},{{end}}
{{if $index}},{{end}}
{
"title": "{{$c.type}}",
"value": "{{$c.message}}",
"short": true
}
{{end}}
]
}]
And I have notifications and the argocd admin notifications
tooling works =)
Just going to add that I had the same issue as GeeThree - I didn't realize that there were no default Triggers & Templates being shipped with the Notification Controller. Once I updated my helm install with the commented defaults starting here things started working as expected. 👍🏻 I think this issue could be closed.
Summary
I followed all the steps mentioned here with an on-sync subscription method. But whenever sync is going on I can see below logs
level=info msg="Trigger on-sync-running result: []" app=argocd/grafana
inargocd-notifications-controlle
pod. There are no notifications on slack.I am using KOPS to manage my cluster.
I am using latest versions of argocd and notification controller
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.