Triggers and Templates Catalog

Getting Started

  • Install Triggers and Templates from the catalog

    1. kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/notifications_catalog/install.yaml

Triggers

NAMEDESCRIPTIONTEMPLATE
on-createdApplication is created.app-created
on-deletedApplication is deleted.app-deleted
on-deployedApplication is synced and healthy. Triggered once per commit.app-deployed
on-health-degradedApplication has degradedapp-health-degraded
on-sync-failedApplication syncing has failedapp-sync-failed
on-sync-runningApplication is being syncedapp-sync-running
on-sync-status-unknownApplication status is ‘Unknown’app-sync-status-unknown
on-sync-succeededApplication syncing has succeededapp-sync-succeeded

Templates

app-created

definition:

  1. email:
  2. subject: Application {{.app.metadata.name}} has been created.
  3. message: Application {{.app.metadata.name}} has been created.
  4. teams:
  5. title: Application {{.app.metadata.name}} has been created.

app-deleted

definition:

  1. email:
  2. subject: Application {{.app.metadata.name}} has been deleted.
  3. message: Application {{.app.metadata.name}} has been deleted.
  4. teams:
  5. title: Application {{.app.metadata.name}} has been deleted.

app-deployed

definition:

  1. email:
  2. subject: New version of an application {{.app.metadata.name}} is up and running.
  3. message: |
  4. {{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} is now running new version of deployments manifests.
  5. slack:
  6. attachments: |
  7. [{
  8. "title": "{{ .app.metadata.name}}",
  9. "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
  10. "color": "#18be52",
  11. "fields": [
  12. {
  13. "title": "Sync Status",
  14. "value": "{{.app.status.sync.status}}",
  15. "short": true
  16. },
  17. {
  18. "title": "Repository",
  19. "value": "{{.app.spec.source.repoURL}}",
  20. "short": true
  21. },
  22. {
  23. "title": "Revision",
  24. "value": "{{.app.status.sync.revision}}",
  25. "short": true
  26. }
  27. {{range $index, $c := .app.status.conditions}}
  28. ,
  29. {
  30. "title": "{{$c.type}}",
  31. "value": "{{$c.message}}",
  32. "short": true
  33. }
  34. {{end}}
  35. ]
  36. }]
  37. deliveryPolicy: Post
  38. groupingKey: ""
  39. notifyBroadcast: false
  40. teams:
  41. facts: |
  42. [{
  43. "name": "Sync Status",
  44. "value": "{{.app.status.sync.status}}"
  45. },
  46. {
  47. "name": "Repository",
  48. "value": "{{.app.spec.source.repoURL}}"
  49. },
  50. {
  51. "name": "Revision",
  52. "value": "{{.app.status.sync.revision}}"
  53. }
  54. {{range $index, $c := .app.status.conditions}}
  55. ,
  56. {
  57. "name": "{{$c.type}}",
  58. "value": "{{$c.message}}"
  59. }
  60. {{end}}
  61. ]
  62. potentialAction: |-
  63. [{
  64. "@type":"OpenUri",
  65. "name":"Operation Application",
  66. "targets":[{
  67. "os":"default",
  68. "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}"
  69. }]
  70. },
  71. {
  72. "@type":"OpenUri",
  73. "name":"Open Repository",
  74. "targets":[{
  75. "os":"default",
  76. "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
  77. }]
  78. }]
  79. themeColor: '#000080'
  80. title: New version of an application {{.app.metadata.name}} is up and running.

app-health-degraded

definition:

  1. email:
  2. subject: Application {{.app.metadata.name}} has degraded.
  3. message: |
  4. {{if eq .serviceType "slack"}}:exclamation:{{end}} Application {{.app.metadata.name}} has degraded.
  5. Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.
  6. slack:
  7. attachments: |
  8. [{
  9. "title": "{{ .app.metadata.name}}",
  10. "title_link": "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
  11. "color": "#f4c030",
  12. "fields": [
  13. {
  14. "title": "Health Status",
  15. "value": "{{.app.status.health.status}}",
  16. "short": true
  17. },
  18. {
  19. "title": "Repository",
  20. "value": "{{.app.spec.source.repoURL}}",
  21. "short": true
  22. }
  23. {{range $index, $c := .app.status.conditions}}
  24. ,
  25. {
  26. "title": "{{$c.type}}",
  27. "value": "{{$c.message}}",
  28. "short": true
  29. }
  30. {{end}}
  31. ]
  32. }]
  33. deliveryPolicy: Post
  34. groupingKey: ""
  35. notifyBroadcast: false
  36. teams:
  37. facts: |
  38. [{
  39. "name": "Health Status",
  40. "value": "{{.app.status.health.status}}"
  41. },
  42. {
  43. "name": "Repository",
  44. "value": "{{.app.spec.source.repoURL}}"
  45. }
  46. {{range $index, $c := .app.status.conditions}}
  47. ,
  48. {
  49. "name": "{{$c.type}}",
  50. "value": "{{$c.message}}"
  51. }
  52. {{end}}
  53. ]
  54. potentialAction: |
  55. [{
  56. "@type":"OpenUri",
  57. "name":"Open Application",
  58. "targets":[{
  59. "os":"default",
  60. "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}"
  61. }]
  62. },
  63. {
  64. "@type":"OpenUri",
  65. "name":"Open Repository",
  66. "targets":[{
  67. "os":"default",
  68. "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
  69. }]
  70. }]
  71. themeColor: '#FF0000'
  72. title: Application {{.app.metadata.name}} has degraded.

app-sync-failed

definition:

  1. email:
  2. subject: Failed to sync application {{.app.metadata.name}}.
  3. message: |
  4. {{if eq .serviceType "slack"}}:exclamation:{{end}} The sync operation of application {{.app.metadata.name}} has failed at {{.app.status.operationState.finishedAt}} with the following error: {{.app.status.operationState.message}}
  5. Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .
  6. slack:
  7. attachments: |
  8. [{
  9. "title": "{{ .app.metadata.name}}",
  10. "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
  11. "color": "#E96D76",
  12. "fields": [
  13. {
  14. "title": "Sync Status",
  15. "value": "{{.app.status.sync.status}}",
  16. "short": true
  17. },
  18. {
  19. "title": "Repository",
  20. "value": "{{.app.spec.source.repoURL}}",
  21. "short": true
  22. }
  23. {{range $index, $c := .app.status.conditions}}
  24. ,
  25. {
  26. "title": "{{$c.type}}",
  27. "value": "{{$c.message}}",
  28. "short": true
  29. }
  30. {{end}}
  31. ]
  32. }]
  33. deliveryPolicy: Post
  34. groupingKey: ""
  35. notifyBroadcast: false
  36. teams:
  37. facts: |
  38. [{
  39. "name": "Sync Status",
  40. "value": "{{.app.status.sync.status}}"
  41. },
  42. {
  43. "name": "Failed at",
  44. "value": "{{.app.status.operationState.finishedAt}}"
  45. },
  46. {
  47. "name": "Repository",
  48. "value": "{{.app.spec.source.repoURL}}"
  49. }
  50. {{range $index, $c := .app.status.conditions}}
  51. ,
  52. {
  53. "name": "{{$c.type}}",
  54. "value": "{{$c.message}}"
  55. }
  56. {{end}}
  57. ]
  58. potentialAction: |-
  59. [{
  60. "@type":"OpenUri",
  61. "name":"Open Operation",
  62. "targets":[{
  63. "os":"default",
  64. "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
  65. }]
  66. },
  67. {
  68. "@type":"OpenUri",
  69. "name":"Open Repository",
  70. "targets":[{
  71. "os":"default",
  72. "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
  73. }]
  74. }]
  75. themeColor: '#FF0000'
  76. title: Failed to sync application {{.app.metadata.name}}.

app-sync-running

definition:

  1. email:
  2. subject: Start syncing application {{.app.metadata.name}}.
  3. message: |
  4. The sync operation of application {{.app.metadata.name}} has started at {{.app.status.operationState.startedAt}}.
  5. Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .
  6. slack:
  7. attachments: |
  8. [{
  9. "title": "{{ .app.metadata.name}}",
  10. "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
  11. "color": "#0DADEA",
  12. "fields": [
  13. {
  14. "title": "Sync Status",
  15. "value": "{{.app.status.sync.status}}",
  16. "short": true
  17. },
  18. {
  19. "title": "Repository",
  20. "value": "{{.app.spec.source.repoURL}}",
  21. "short": true
  22. }
  23. {{range $index, $c := .app.status.conditions}}
  24. ,
  25. {
  26. "title": "{{$c.type}}",
  27. "value": "{{$c.message}}",
  28. "short": true
  29. }
  30. {{end}}
  31. ]
  32. }]
  33. deliveryPolicy: Post
  34. groupingKey: ""
  35. notifyBroadcast: false
  36. teams:
  37. facts: |
  38. [{
  39. "name": "Sync Status",
  40. "value": "{{.app.status.sync.status}}"
  41. },
  42. {
  43. "name": "Started at",
  44. "value": "{{.app.status.operationState.startedAt}}"
  45. },
  46. {
  47. "name": "Repository",
  48. "value": "{{.app.spec.source.repoURL}}"
  49. }
  50. {{range $index, $c := .app.status.conditions}}
  51. ,
  52. {
  53. "name": "{{$c.type}}",
  54. "value": "{{$c.message}}"
  55. }
  56. {{end}}
  57. ]
  58. potentialAction: |-
  59. [{
  60. "@type":"OpenUri",
  61. "name":"Open Operation",
  62. "targets":[{
  63. "os":"default",
  64. "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
  65. }]
  66. },
  67. {
  68. "@type":"OpenUri",
  69. "name":"Open Repository",
  70. "targets":[{
  71. "os":"default",
  72. "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
  73. }]
  74. }]
  75. title: Start syncing application {{.app.metadata.name}}.

app-sync-status-unknown

definition:

  1. email:
  2. subject: Application {{.app.metadata.name}} sync status is 'Unknown'
  3. message: |
  4. {{if eq .serviceType "slack"}}:exclamation:{{end}} Application {{.app.metadata.name}} sync is 'Unknown'.
  5. Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.
  6. {{if ne .serviceType "slack"}}
  7. {{range $c := .app.status.conditions}}
  8. * {{$c.message}}
  9. {{end}}
  10. {{end}}
  11. slack:
  12. attachments: |
  13. [{
  14. "title": "{{ .app.metadata.name}}",
  15. "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
  16. "color": "#E96D76",
  17. "fields": [
  18. {
  19. "title": "Sync Status",
  20. "value": "{{.app.status.sync.status}}",
  21. "short": true
  22. },
  23. {
  24. "title": "Repository",
  25. "value": "{{.app.spec.source.repoURL}}",
  26. "short": true
  27. }
  28. {{range $index, $c := .app.status.conditions}}
  29. ,
  30. {
  31. "title": "{{$c.type}}",
  32. "value": "{{$c.message}}",
  33. "short": true
  34. }
  35. {{end}}
  36. ]
  37. }]
  38. deliveryPolicy: Post
  39. groupingKey: ""
  40. notifyBroadcast: false
  41. teams:
  42. facts: |
  43. [{
  44. "name": "Sync Status",
  45. "value": "{{.app.status.sync.status}}"
  46. },
  47. {
  48. "name": "Repository",
  49. "value": "{{.app.spec.source.repoURL}}"
  50. }
  51. {{range $index, $c := .app.status.conditions}}
  52. ,
  53. {
  54. "name": "{{$c.type}}",
  55. "value": "{{$c.message}}"
  56. }
  57. {{end}}
  58. ]
  59. potentialAction: |-
  60. [{
  61. "@type":"OpenUri",
  62. "name":"Open Application",
  63. "targets":[{
  64. "os":"default",
  65. "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}"
  66. }]
  67. },
  68. {
  69. "@type":"OpenUri",
  70. "name":"Open Repository",
  71. "targets":[{
  72. "os":"default",
  73. "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
  74. }]
  75. }]
  76. title: Application {{.app.metadata.name}} sync status is 'Unknown'

app-sync-succeeded

definition:

  1. email:
  2. subject: Application {{.app.metadata.name}} has been successfully synced.
  3. message: |
  4. {{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} has been successfully synced at {{.app.status.operationState.finishedAt}}.
  5. Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .
  6. slack:
  7. attachments: |
  8. [{
  9. "title": "{{ .app.metadata.name}}",
  10. "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
  11. "color": "#18be52",
  12. "fields": [
  13. {
  14. "title": "Sync Status",
  15. "value": "{{.app.status.sync.status}}",
  16. "short": true
  17. },
  18. {
  19. "title": "Repository",
  20. "value": "{{.app.spec.source.repoURL}}",
  21. "short": true
  22. }
  23. {{range $index, $c := .app.status.conditions}}
  24. ,
  25. {
  26. "title": "{{$c.type}}",
  27. "value": "{{$c.message}}",
  28. "short": true
  29. }
  30. {{end}}
  31. ]
  32. }]
  33. deliveryPolicy: Post
  34. groupingKey: ""
  35. notifyBroadcast: false
  36. teams:
  37. facts: |
  38. [{
  39. "name": "Sync Status",
  40. "value": "{{.app.status.sync.status}}"
  41. },
  42. {
  43. "name": "Synced at",
  44. "value": "{{.app.status.operationState.finishedAt}}"
  45. },
  46. {
  47. "name": "Repository",
  48. "value": "{{.app.spec.source.repoURL}}"
  49. }
  50. {{range $index, $c := .app.status.conditions}}
  51. ,
  52. {
  53. "name": "{{$c.type}}",
  54. "value": "{{$c.message}}"
  55. }
  56. {{end}}
  57. ]
  58. potentialAction: |-
  59. [{
  60. "@type":"OpenUri",
  61. "name":"Operation Details",
  62. "targets":[{
  63. "os":"default",
  64. "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
  65. }]
  66. },
  67. {
  68. "@type":"OpenUri",
  69. "name":"Open Repository",
  70. "targets":[{
  71. "os":"default",
  72. "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
  73. }]
  74. }]
  75. themeColor: '#000080'
  76. title: Application {{.app.metadata.name}} has been successfully synced