Skip to content

Commit cab9773

Browse files
committed
argocd: clean up argocd-notifications config
1 parent d1b9461 commit cab9773

10 files changed

+72
-98
lines changed

argocd/argo-cd-service-monitor.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,19 @@ spec:
5858
app.kubernetes.io/name: argocd-applicationset-controller
5959
endpoints:
6060
- port: metrics
61+
---
62+
# https://argoproj-labs.github.io/argocd-notifications/monitoring/
63+
apiVersion: monitoring.coreos.com/v1
64+
kind: ServiceMonitor
65+
metadata:
66+
name: argocd-notifications-controller-metrics
67+
annotations:
68+
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
69+
labels:
70+
prometheusInstance: default
71+
spec:
72+
selector:
73+
matchLabels:
74+
app.kubernetes.io/name: argocd-notifications-controller-metrics
75+
endpoints:
76+
- port: metrics
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: argocd-notifications-cm
5+
data:
6+
trigger.sync-operation-failed: |
7+
when: app.status.operationState.phase in ['Error', 'Failed']
8+
send: [sync-operation-status-change]
9+
trigger.sync-operation-succeeded: |
10+
when: app.status.operationState.phase in ['Succeeded']
11+
send: [sync-operation-status-change]
12+
trigger.sync-operation-running: |
13+
when: app.status.operationState.phase in ['Running']
14+
send: [sync-operation-status-change]
15+
trigger.out-of-sync: |
16+
when: app.status.sync.status == 'OutOfSync'
17+
send: [out-of-sync]
18+
trigger.build-failed: |
19+
when: app.status.sync.status == 'Unknown' and app.status.sync.revision != nil
20+
send: [build-failed]
21+
trigger.app-unhealthy: |
22+
when: app.status.health.status == 'Degraded'
23+
send: [app-unhealthy]
24+
25+
template.sync-operation-status-change: |
26+
webhook:
27+
bitbot:
28+
method: POST
29+
body: "Sync for application \x0315{{.app.metadata.name}}\x03 (\x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03) {{
30+
if eq .app.status.operationState.phase \"Running\" }}is \x0307running\x03{{end}}{{
31+
if eq .app.status.operationState.phase \"Succeeded\"}}has \x0303succeeded\x03: {{.app.status.operationState.message}}{{end}}{{
32+
if eq .app.status.operationState.phase \"Error\" }}has \x0304errored\x03: {{.app.status.operationState.message}}{{end}}{{
33+
if eq .app.status.operationState.phase \"Failed\" }}has \x0304failed\x03: {{.app.status.operationState.message}}{{end
34+
}} {{ if ne .app.status.operationState.phase \"Succeeded\" }}(blame \x0315{{.app.status.operationState.operation.initiatedBy.username}}\x03){{end}}"
35+
template.app-unhealthy: |
36+
webhook:
37+
bitbot:
38+
method: POST
39+
body: "Application {{.app.metadata.name}} has \x0304degraded\x03 (Commit: \x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03)"
40+
template.out-of-sync: |
41+
webhook:
42+
bitbot:
43+
method: POST
44+
body: "Application {{.app.metadata.name}} is out of sync (Targeting: \x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03)"
45+
template.build-failed: |
46+
webhook:
47+
bitbot:
48+
method: POST
49+
body: "Unable to build {{.app.metadata.name}} (Commit: \x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03)"
File renamed without changes.

argocd/argocd-notifications/README.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

argocd/argocd-notifications/cm-patch.yaml

Lines changed: 0 additions & 53 deletions
This file was deleted.

argocd/argocd-notifications/kustomization.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

argocd/argocd-notifications/secret-generator.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

argocd/argocd-notifications/service-monitor.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

argocd/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ namespace: argocd
44
resources:
55
- github.com/argoproj/argo-cd/manifests/cluster-install?ref=148d8da7a996f6c9f4d102fdd8e688c2ff3fd8c7 # tag=v2.5.2
66
- ingress.yaml
7+
- argocd-notifications-cm.yaml
78
- argo-cd-service-monitor.yaml
89
- deploy-key.yaml
910
# Projects

argocd/secret-generator.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,11 @@ metadata:
44
name: argocd-ksops-secrets
55
files:
66
- ./argocd-secret.enc.yaml
7+
8+
# This secret contains
9+
# - an API Key for bitbot
10+
# - an API Key to `http://grafana.monitoring.svc/api`
11+
- ./argocd-notifications-secret.enc.yaml
12+
713
- ./deploy-key.enc.yaml
814
- ./ssh-key.enc.yaml

0 commit comments

Comments
 (0)