argocd notifications
This commit is contained in:
@@ -20,3 +20,77 @@ server:
|
||||
extraArgs:
|
||||
- --insecure
|
||||
- --disable-auth
|
||||
|
||||
notifications:
|
||||
# Don't create secret via Helm - using SealedSecret instead
|
||||
secret:
|
||||
create: false
|
||||
|
||||
# Configure notification service and templates
|
||||
cm:
|
||||
# Define Slack service using webhook URL from sealed secret
|
||||
service.webhook.slack: |
|
||||
url: $slack-webhook-url
|
||||
headers:
|
||||
- name: Content-Type
|
||||
value: application/json
|
||||
|
||||
# Template: Application syncing
|
||||
template.app-syncing: |
|
||||
webhook:
|
||||
slack:
|
||||
method: POST
|
||||
body: |
|
||||
{
|
||||
"text": "🔄 *{{ .app.metadata.name }}* is syncing...\n📦 Revision: {{ .app.status.sync.revision | substr 0 7 }}"
|
||||
}
|
||||
|
||||
# Template: Sync succeeded
|
||||
template.app-sync-succeeded: |
|
||||
webhook:
|
||||
slack:
|
||||
method: POST
|
||||
body: |
|
||||
{
|
||||
"text": "✅ *{{ .app.metadata.name }}* sync succeeded\n📦 Revision: {{ .app.status.sync.revision | substr 0 7 }}{{ range .app.status.summary.images }}\n🏷️ Image: {{ . }}{{ end }}"
|
||||
}
|
||||
|
||||
# Template: Sync failed
|
||||
template.app-sync-failed: |
|
||||
webhook:
|
||||
slack:
|
||||
method: POST
|
||||
body: |
|
||||
{
|
||||
"text": "❌ *{{ .app.metadata.name }}* sync failed\n📦 Revision: {{ .app.status.sync.revision | substr 0 7 }}\n⚠️ Message: {{ .app.status.operationState.message }}"
|
||||
}
|
||||
|
||||
# Template: Application degraded
|
||||
template.app-degraded: |
|
||||
webhook:
|
||||
slack:
|
||||
method: POST
|
||||
body: |
|
||||
{
|
||||
"text": "⚠️ *{{ .app.metadata.name }}* is degraded\n🏥 Health: {{ .app.status.health.status }}\n💬 Message: {{ .app.status.health.message }}"
|
||||
}
|
||||
|
||||
# Trigger: Sync running
|
||||
trigger.on-sync-running: |
|
||||
- when: app.status.operationState.phase in ['Running']
|
||||
send: [app-syncing]
|
||||
|
||||
# Trigger: Sync succeeded
|
||||
trigger.on-sync-succeeded: |
|
||||
- when: app.status.operationState.phase in ['Succeeded']
|
||||
send: [app-sync-succeeded]
|
||||
|
||||
# Trigger: Sync failed
|
||||
trigger.on-sync-failed: |
|
||||
- when: app.status.operationState.phase in ['Failed']
|
||||
send: [app-sync-failed]
|
||||
|
||||
# Trigger: Application degraded
|
||||
trigger.on-degraded: |
|
||||
- when: app.status.health.status == 'Degraded'
|
||||
send: [app-degraded]
|
||||
|
||||
Reference in New Issue
Block a user