Skip to content

Commit 6cef9be

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

10 files changed

+83
-102
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: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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)"
50+
51+
service.grafana: |
52+
apiUrl: http://grafana.monitoring.svc/api
53+
apiKey: $grafana-apiKey
54+
service.webhook.bitbot: |
55+
url: $bitbot-url

argocd/argocd-notifications/secret.enc.yaml renamed to argocd/argocd-notifications-secret.enc.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ metadata:
66
kustomize.config.k8s.io/behavior: merge
77
type: Opaque
88
stringData:
9-
notifiers.yaml: ENC[AES256_GCM,data:Ots4ChIx6PmbR4TVIfH/Doeh/U0UlvghABhZQhwA2kCI78puVch5znibz3CekJ0vzZqWlE35J0rtds0f+mPlQT8Ov4KI9ctu+wUAiAeSJHuihD0E3rmDjQR7GDrLv7TgySFdxUG3JgVzs/MheIuwGLtAsQSf+L9xpUToYT1WxJAdfENg8Sljl6d5H9vWfsTtA+PbB182LcP+3R5sEkOOKiSIEY0fxCd5J9DqQs/0sDrAnqf9eTOSeMTIYAfBjC7GUlA0nVFysqFZtzg38zr71AG5vLghYIjxQWZ3b/NPuRGYiZYtmWG3aeWV85qxPlN/8q8JHmW0gLkMLKa2TtpfD78D3Kp+IIhNFbr+ibV5X4i9emyVpnmBs/c=,iv:SOD/sZ/2MoS7IPTENrh3VQBpPz33DXU+8MOzGOqF2Do=,tag:1QQ7L+Vr191wxOE605gzXA==,type:str]
9+
bitbot-url: ENC[AES256_GCM,data:zjGwg8bRwU5ESoRrc/iYuCzxDu53PF2x4s5Azkvuze78xU0Ks9u1MOM5uTuWKJh2gdtYHxfwsRRZWORL/NJgJjU1HanzvgJLDupo4Fjk4t0=,iv:uAEHApURr6TULJLZYZKhQnKHBcIO57BSnJaZWVFaWl0=,tag:w9Jps7Dt5b05bfOhCTBcvA==,type:str]
10+
grafana-apiKey: ENC[AES256_GCM,data:lRsvUKWTtmZAwbjOE07nvfM3raGmnEagHxdruVRginmAVAnoyzqFkRqRX/hivyyN2yCv4VFQjiB6Q/Tka9WUXsemIoK+ojY2HrTs6hpeqG/Vz5qCtz5dArO+hCZ8s/jYvUgWNyQ=,iv:q0qnszBWsqAkyQPSljAJqXSPGnrpoIEBvrfnIL5Q/tg=,tag:PJtxZKaMO0IYXCo0ooQtOg==,type:str]
1011
sops:
1112
kms: []
1213
gcp_kms: []
1314
azure_kv: []
1415
hc_vault: []
1516
age: []
16-
lastmodified: "2020-06-13T13:33:34Z"
17-
mac: ENC[AES256_GCM,data:ij4HjVpnB8r67jsnVilXIIqutFMhsUG3tzuypEO9/JjtnpTtGxWgRD/LjMDRe8s4dx7E6e+U9m9CEtk+0kF8R3v16uq+JDxh/GPBMNI+AfuV6GIQvphDOpdMAnsHNDpFK2/M023L6cqWjhT12KONifyF+ezUKqzzHEfCpmuIF4k=,iv:vla5VknPn92ZZy2RejUQdwS+xlY8AsAV9Rtk13GgGXs=,tag:tAuvs0pokRTD6qxq6UXbpg==,type:str]
17+
lastmodified: "2022-11-08T11:54:57Z"
18+
mac: ENC[AES256_GCM,data:Q1u1tcYlN8MMrNSxAtADVD7hyYz6blKM2ODU8n5LjyNx4E2f7XiGqdly9T4H169QjIaMkHTs1kdd2zWnCTJVupDlVOwU2Znu13tNjUutzhYmBObFd2zXp15NLPD5vN4xLhwqVKTjVrylPq6i0pux06rWN0xMMgXaWduz/7pYV4A=,iv:vfpvGJ623lo8OWLuH7tdDY8Vc52LMblv7Ae7MaPzU8M=,tag:aO2q7JDIZpeH0+mj8Lp1Ig==,type:str]
1819
pgp:
1920
- created_at: "2022-05-21T04:35:09Z"
2021
enc: |-
@@ -157,4 +158,4 @@ sops:
157158
-----END PGP MESSAGE-----
158159
fp: 1FD6667A0808D4D48BDB8757A61B48D8288FCF8A
159160
encrypted_regex: ^(data|stringData)$
160-
version: 3.5.0
161+
version: 3.7.3

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
@@ -23,6 +23,7 @@ resources:
2323
- applications/userdb-api.yaml
2424
- applications/webirc.yaml
2525
patches:
26+
- argocd-notifications-cm.patch.yaml
2627
- argo-cd-repo-server-ksops.patch.yaml
2728
- argo-cd-allow-alpha-plugins.patch.yaml
2829
- argo-cd-import-pgp-key.patch.yaml

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)