diff --git a/argocd/application-n8n.yaml b/argocd/application-n8n.yaml new file mode 100644 index 0000000..a666f6b --- /dev/null +++ b/argocd/application-n8n.yaml @@ -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 diff --git a/argocd/application-polymarket-bot.yaml b/argocd/application-polymarket-bot.yaml new file mode 100644 index 0000000..8ef8191 --- /dev/null +++ b/argocd/application-polymarket-bot.yaml @@ -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 diff --git a/argocd/configmap-argocd-notifications-cm.yaml b/argocd/configmap-argocd-notifications-cm.yaml index bcac53d..2ab38be 100644 --- a/argocd/configmap-argocd-notifications-cm.yaml +++ b/argocd/configmap-argocd-notifications-cm.yaml @@ -7,4 +7,36 @@ metadata: app.kubernetes.io/part-of: argocd name: argocd-notifications-cm 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]