triggers
This commit is contained in:
@@ -26,16 +26,8 @@ notifications:
|
|||||||
secret:
|
secret:
|
||||||
create: false
|
create: false
|
||||||
|
|
||||||
# Configure notification service and templates
|
# Define notification templates
|
||||||
cm:
|
templates:
|
||||||
# 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: |
|
template.app-syncing: |
|
||||||
webhook:
|
webhook:
|
||||||
slack:
|
slack:
|
||||||
@@ -44,8 +36,6 @@ notifications:
|
|||||||
{
|
{
|
||||||
"text": "🔄 *{{ .app.metadata.name }}* is syncing...\n📦 Revision: {{ .app.status.sync.revision | substr 0 7 }}"
|
"text": "🔄 *{{ .app.metadata.name }}* is syncing...\n📦 Revision: {{ .app.status.sync.revision | substr 0 7 }}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Template: Sync succeeded
|
|
||||||
template.app-sync-succeeded: |
|
template.app-sync-succeeded: |
|
||||||
webhook:
|
webhook:
|
||||||
slack:
|
slack:
|
||||||
@@ -54,8 +44,6 @@ notifications:
|
|||||||
{
|
{
|
||||||
"text": "✅ *{{ .app.metadata.name }}* sync succeeded\n📦 Revision: {{ .app.status.sync.revision | substr 0 7 }}{{ range .app.status.summary.images }}\n🏷️ Image: {{ . }}{{ end }}"
|
"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: |
|
template.app-sync-failed: |
|
||||||
webhook:
|
webhook:
|
||||||
slack:
|
slack:
|
||||||
@@ -64,8 +52,6 @@ notifications:
|
|||||||
{
|
{
|
||||||
"text": "❌ *{{ .app.metadata.name }}* sync failed\n📦 Revision: {{ .app.status.sync.revision | substr 0 7 }}\n⚠️ Message: {{ .app.status.operationState.message }}"
|
"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: |
|
template.app-degraded: |
|
||||||
webhook:
|
webhook:
|
||||||
slack:
|
slack:
|
||||||
@@ -75,22 +61,25 @@ notifications:
|
|||||||
"text": "⚠️ *{{ .app.metadata.name }}* is degraded\n🏥 Health: {{ .app.status.health.status }}\n💬 Message: {{ .app.status.health.message }}"
|
"text": "⚠️ *{{ .app.metadata.name }}* is degraded\n🏥 Health: {{ .app.status.health.status }}\n💬 Message: {{ .app.status.health.message }}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Trigger: Sync running
|
# Define notification triggers
|
||||||
|
triggers:
|
||||||
trigger.on-sync-running: |
|
trigger.on-sync-running: |
|
||||||
- when: app.status.operationState.phase in ['Running']
|
- when: app.status.operationState.phase in ['Running']
|
||||||
send: [app-syncing]
|
send: [app-syncing]
|
||||||
|
|
||||||
# Trigger: Sync succeeded
|
|
||||||
trigger.on-sync-succeeded: |
|
trigger.on-sync-succeeded: |
|
||||||
- when: app.status.operationState.phase in ['Succeeded']
|
- when: app.status.operationState.phase in ['Succeeded']
|
||||||
send: [app-sync-succeeded]
|
send: [app-sync-succeeded]
|
||||||
|
|
||||||
# Trigger: Sync failed
|
|
||||||
trigger.on-sync-failed: |
|
trigger.on-sync-failed: |
|
||||||
- when: app.status.operationState.phase in ['Failed']
|
- when: app.status.operationState.phase in ['Failed']
|
||||||
send: [app-sync-failed]
|
send: [app-sync-failed]
|
||||||
|
|
||||||
# Trigger: Application degraded
|
|
||||||
trigger.on-degraded: |
|
trigger.on-degraded: |
|
||||||
- when: app.status.health.status == 'Degraded'
|
- when: app.status.health.status == 'Degraded'
|
||||||
send: [app-degraded]
|
send: [app-degraded]
|
||||||
|
|
||||||
|
# Define notification services (webhook for Slack)
|
||||||
|
notifiers:
|
||||||
|
service.webhook.slack: |
|
||||||
|
url: $slack-webhook-url
|
||||||
|
headers:
|
||||||
|
- name: Content-Type
|
||||||
|
value: application/json
|
||||||
|
|||||||
Reference in New Issue
Block a user