복사 apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
namespace: argocd
data:
template.app-sync-succeeded: |
message: |
Application {{.app.metadata.name}} has been successfully synced.
slack:
attachments: |
[{
"color": "#18be52",
"title": "{{ .app.metadata.name }}",
"title_link": "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
"fields": [
{
"title": "Sync Status",
"value": "{{.app.status.sync.status}}",
"short": true
},
{
"title": "Health Status",
"value": "{{.app.status.health.status}}",
"short": true
},
{
"title": "Revision",
"value": "{{.app.status.sync.revision | substr 0 7}}",
"short": true
},
{
"title": "Repository",
"value": "{{.app.spec.source.repoURL}}",
"short": true
}
],
"footer": "ArgoCD",
"footer_icon": "https://argo-cd.readthedocs.io/en/stable/assets/logo.png"
}]
template.app-sync-failed: |
message: |
Application {{.app.metadata.name}} sync failed.
slack:
attachments: |
[{
"color": "#E96D76",
"title": "{{ .app.metadata.name }} - Sync Failed",
"title_link": "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
"fields": [
{
"title": "Sync Status",
"value": "{{.app.status.sync.status}}",
"short": true
},
{
"title": "Health Status",
"value": "{{.app.status.health.status}}",
"short": true
},
{
"title": "Error Message",
"value": "{{.app.status.operationState.message}}",
"short": false
}
]
}]
template.app-health-degraded: |
message: |
Application {{.app.metadata.name}} health is degraded.
slack:
attachments: |
[{
"color": "#f4c030",
"title": "{{ .app.metadata.name }} - Health Degraded",
"title_link": "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
"fields": [
{
"title": "Health Status",
"value": "{{.app.status.health.status}}",
"short": true
},
{
"title": "Message",
"value": "{{.app.status.health.message}}",
"short": false
}
]
}]