Files
k8s-manifests/argocd/configmap-argocd-notifications-cm.yaml
chemavxandClaude Fable 5 23abc484c7 feat(argocd): recover Telegram notifications (failed/degraded) and prune for polymarket-bot
- Notifications via generic webhook to the Telegram Bot API: the engine's
  native telegram service only supports channels and negative group IDs,
  so a positive private chat_id never worked ("chat not found").
- Only on-sync-failed and on-health-degraded triggers; on-sync-succeeded
  dropped (CI already reports successful deploys).
- Subscribe annotations on polymarket-bot, researchowl and n8n.
- prune: true on polymarket-bot, guarded by Prune=false on the postgres
  PVC so removing the manifest from git can never destroy the data.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 15:31:07 +00:00

44 lines
1.6 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
labels:
app.kubernetes.io/component: notifications-controller
app.kubernetes.io/name: argocd-notifications-controller
app.kubernetes.io/part-of: argocd
name: argocd-notifications-cm
namespace: argocd
data:
# The native telegram service of the notifications engine only supports
# channels (@name) and negative group chat IDs; a positive private chat ID
# like ours gets sent as "@<id>" and fails with "chat not found". Workaround:
# a generic webhook service against the Telegram Bot API, which accepts any
# chat_id. The service is still named "telegram" so the subscribe annotations
# read naturally.
service.webhook.telegram: |
url: https://api.telegram.org/bot$telegram-token/sendMessage
headers:
- name: Content-Type
value: application/json
template.app-sync-failed: |
webhook:
telegram:
method: POST
body: |
{"chat_id": "5138407666", "text": {{toJson (printf "❌ ArgoCD: %s sync fallido\n%s" .app.metadata.name (or .app.status.operationState.message ""))}}}
template.app-degraded: |
webhook:
telegram:
method: POST
body: |
{"chat_id": "5138407666", "text": {{toJson (printf "⚠️ ArgoCD: %s degradada\nHealth: %s" .app.metadata.name .app.status.health.status)}}}
trigger.on-sync-failed: |
- when: app.status.operationState != nil && app.status.operationState.phase in ['Error', 'Failed']
send: [app-sync-failed]
trigger.on-health-degraded: |
- when: app.status.health.status == 'Degraded'
send: [app-degraded]