|
| 1 | +apiVersion: v1 |
| 2 | +kind: ConfigMap |
| 3 | +metadata: |
| 4 | + name: argocd-notifications-cm |
| 5 | + namespace: argocd |
| 6 | +data: |
| 7 | + service.webhook.slack_webhook: | |
| 8 | + url: https://hooks.slack.com/workflows/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 |
| 9 | + headers: |
| 10 | + - name: Content-Type |
| 11 | + value: application/json |
| 12 | +
|
| 13 | + service.webhook.slack_webhook_deleted: | |
| 14 | + url: https://hooks.slack.com/workflows/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 |
| 15 | + headers: |
| 16 | + - name: Content-Type |
| 17 | + value: application/json |
| 18 | +
|
| 19 | + template.send-slack: | |
| 20 | + webhook: |
| 21 | + slack_webhook: |
| 22 | + method: POST |
| 23 | + body: | |
| 24 | + { |
| 25 | + "name": "{{.app.metadata.name}}", |
| 26 | + "email": "{{.app.metadata.annotations.owner}}", |
| 27 | + "url": "{{index .app.status.summary.externalURLs 0}}", |
| 28 | + "syncStatus": "{{.app.status.sync.status}}", |
| 29 | + "healthStatus": "{{.app.status.health.status}}", |
| 30 | + "operationPhase": "{{.app.status.operationState.phase}}", |
| 31 | + "content": "{{.app.status.operationState.message}}" |
| 32 | + } |
| 33 | +
|
| 34 | + template.send-slack-deleted: | |
| 35 | + webhook: |
| 36 | + slack_webhook_deleted: |
| 37 | + method: POST |
| 38 | + body: | |
| 39 | + { |
| 40 | + "name": "{{.app.metadata.name}}", |
| 41 | + "email": "{{.app.metadata.annotations.owner}}", |
| 42 | + } |
| 43 | +
|
| 44 | + trigger.on-deployed: | |
| 45 | + - description: Application is synced and healthy. Triggered once per commit. |
| 46 | + oncePer: app.status.operationState.syncResult.revision |
| 47 | + send: |
| 48 | + - send-slack |
| 49 | + when: app.status.operationState.phase in ['Succeeded'] and app.status.health.status |
| 50 | + == 'Healthy' |
| 51 | + trigger.on-health-degraded: | |
| 52 | + - description: Application has degraded |
| 53 | + send: |
| 54 | + - send-slack |
| 55 | + when: app.status.health.status == 'Degraded' |
| 56 | + trigger.on-sync-failed: | |
| 57 | + - description: Application syncing has failed |
| 58 | + send: |
| 59 | + - send-slack |
| 60 | + when: app.status.operationState.phase in ['Error', 'Failed'] |
| 61 | + trigger.on-deleted: | |
| 62 | + - description: Application is deleted. |
| 63 | + oncePer: app.metadata.name |
| 64 | + send: |
| 65 | + - send-slack-deleted |
| 66 | + when: app.metadata.deletionTimestamp != nil |
0 commit comments