argocd: configure Telegram notifications and add Application manifests
- Configure argocd-notifications-cm with Telegram service, templates and triggers for sync-succeeded, sync-failed, and app-degraded events - Add application-polymarket-bot.yaml and application-n8n.yaml with notification subscription annotations (chat_id: 5138407666) Note: requires kubectl patch of argocd-notifications-secret with telegram-token Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: n8n
|
||||||
|
namespace: argocd
|
||||||
|
annotations:
|
||||||
|
notifications.argoproj.io/subscribe.on-sync-succeeded.telegram: "5138407666"
|
||||||
|
notifications.argoproj.io/subscribe.on-sync-failed.telegram: "5138407666"
|
||||||
|
notifications.argoproj.io/subscribe.on-degraded.telegram: "5138407666"
|
||||||
|
spec:
|
||||||
|
project: default
|
||||||
|
source:
|
||||||
|
repoURL: http://gitea.gitea.svc.cluster.local:3000/chemavx/k8s-manifests.git
|
||||||
|
targetRevision: main
|
||||||
|
path: n8n
|
||||||
|
destination:
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
namespace: n8n
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: polymarket-bot
|
||||||
|
namespace: argocd
|
||||||
|
annotations:
|
||||||
|
notifications.argoproj.io/subscribe.on-sync-succeeded.telegram: "5138407666"
|
||||||
|
notifications.argoproj.io/subscribe.on-sync-failed.telegram: "5138407666"
|
||||||
|
notifications.argoproj.io/subscribe.on-degraded.telegram: "5138407666"
|
||||||
|
spec:
|
||||||
|
project: default
|
||||||
|
source:
|
||||||
|
repoURL: http://gitea.gitea.svc.cluster.local:3000/chemavx/k8s-manifests.git
|
||||||
|
targetRevision: main
|
||||||
|
path: polymarket-bot
|
||||||
|
destination:
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
namespace: polymarket-bot
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
@@ -7,4 +7,36 @@ metadata:
|
|||||||
app.kubernetes.io/part-of: argocd
|
app.kubernetes.io/part-of: argocd
|
||||||
name: argocd-notifications-cm
|
name: argocd-notifications-cm
|
||||||
namespace: argocd
|
namespace: argocd
|
||||||
|
data:
|
||||||
|
service.telegram: |
|
||||||
|
token: $telegram-token
|
||||||
|
|
||||||
|
template.app-sync-succeeded: |
|
||||||
|
telegram:
|
||||||
|
message: |
|
||||||
|
✅ ArgoCD: {{.app.metadata.name}} sync completado
|
||||||
|
Revisión: {{.app.status.operationState.syncResult.revision | trunc 8}}
|
||||||
|
|
||||||
|
template.app-sync-failed: |
|
||||||
|
telegram:
|
||||||
|
message: |
|
||||||
|
❌ ArgoCD: {{.app.metadata.name}} sync fallido
|
||||||
|
{{if .app.status.operationState.message}}Error: {{.app.status.operationState.message}}{{end}}
|
||||||
|
|
||||||
|
template.app-degraded: |
|
||||||
|
telegram:
|
||||||
|
message: |
|
||||||
|
⚠️ ArgoCD: {{.app.metadata.name}} degradada
|
||||||
|
Health: {{.app.status.health.status}}
|
||||||
|
|
||||||
|
trigger.on-sync-succeeded: |
|
||||||
|
- when: app.status.operationState.phase in ['Succeeded']
|
||||||
|
send: [app-sync-succeeded]
|
||||||
|
|
||||||
|
trigger.on-sync-failed: |
|
||||||
|
- when: app.status.operationState.phase in ['Error', 'Failed']
|
||||||
|
send: [app-sync-failed]
|
||||||
|
|
||||||
|
trigger.on-degraded: |
|
||||||
|
- when: app.status.health.status == 'Degraded'
|
||||||
|
send: [app-degraded]
|
||||||
|
|||||||
Reference in New Issue
Block a user