Skip to content

Commit

Permalink
argocd: clean up argocd-notifications config
Browse files Browse the repository at this point in the history
  • Loading branch information
daurnimator committed Nov 8, 2022
1 parent d1b9461 commit 6cef9be
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 102 deletions.
16 changes: 16 additions & 0 deletions argocd/argo-cd-service-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,19 @@ spec:
app.kubernetes.io/name: argocd-applicationset-controller
endpoints:
- port: metrics
---
# https://argoproj-labs.github.io/argocd-notifications/monitoring/
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: argocd-notifications-controller-metrics
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
labels:
prometheusInstance: default
spec:
selector:
matchLabels:
app.kubernetes.io/name: argocd-notifications-controller-metrics
endpoints:
- port: metrics
55 changes: 55 additions & 0 deletions argocd/argocd-notifications-cm.patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
data:
trigger.sync-operation-failed: |
- when: app.status.operationState.phase in ['Error', 'Failed']
send: [sync-operation-status-change]
trigger.sync-operation-succeeded: |
- when: app.status.operationState.phase in ['Succeeded']
send: [sync-operation-status-change]
trigger.sync-operation-running: |
- when: app.status.operationState.phase in ['Running']
send: [sync-operation-status-change]
trigger.out-of-sync: |
- when: app.status.sync.status == 'OutOfSync'
send: [out-of-sync]
trigger.build-failed: |
- when: app.status.sync.status == 'Unknown' and app.status.sync.revision != nil
send: [build-failed]
trigger.app-unhealthy: |
- when: app.status.health.status == 'Degraded'
send: [app-unhealthy]
template.sync-operation-status-change: |
webhook:
bitbot:
method: POST
body: "Sync for application \x0315{{.app.metadata.name}}\x03 (\x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03) {{
if eq .app.status.operationState.phase \"Running\" }}is \x0307running\x03{{end}}{{
if eq .app.status.operationState.phase \"Succeeded\"}}has \x0303succeeded\x03: {{.app.status.operationState.message}}{{end}}{{
if eq .app.status.operationState.phase \"Error\" }}has \x0304errored\x03: {{.app.status.operationState.message}}{{end}}{{
if eq .app.status.operationState.phase \"Failed\" }}has \x0304failed\x03: {{.app.status.operationState.message}}{{end
}} {{ if ne .app.status.operationState.phase \"Succeeded\" }}(blame \x0315{{.app.status.operationState.operation.initiatedBy.username}}\x03){{end}}"
template.app-unhealthy: |
webhook:
bitbot:
method: POST
body: "Application {{.app.metadata.name}} has \x0304degraded\x03 (Commit: \x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03)"
template.out-of-sync: |
webhook:
bitbot:
method: POST
body: "Application {{.app.metadata.name}} is out of sync (Targeting: \x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03)"
template.build-failed: |
webhook:
bitbot:
method: POST
body: "Unable to build {{.app.metadata.name}} (Commit: \x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03)"
service.grafana: |
apiUrl: http://grafana.monitoring.svc/api
apiKey: $grafana-apiKey
service.webhook.bitbot: |
url: $bitbot-url
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ metadata:
kustomize.config.k8s.io/behavior: merge
type: Opaque
stringData:
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]
bitbot-url: ENC[AES256_GCM,data:zjGwg8bRwU5ESoRrc/iYuCzxDu53PF2x4s5Azkvuze78xU0Ks9u1MOM5uTuWKJh2gdtYHxfwsRRZWORL/NJgJjU1HanzvgJLDupo4Fjk4t0=,iv:uAEHApURr6TULJLZYZKhQnKHBcIO57BSnJaZWVFaWl0=,tag:w9Jps7Dt5b05bfOhCTBcvA==,type:str]
grafana-apiKey: ENC[AES256_GCM,data:lRsvUKWTtmZAwbjOE07nvfM3raGmnEagHxdruVRginmAVAnoyzqFkRqRX/hivyyN2yCv4VFQjiB6Q/Tka9WUXsemIoK+ojY2HrTs6hpeqG/Vz5qCtz5dArO+hCZ8s/jYvUgWNyQ=,iv:q0qnszBWsqAkyQPSljAJqXSPGnrpoIEBvrfnIL5Q/tg=,tag:PJtxZKaMO0IYXCo0ooQtOg==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age: []
lastmodified: "2020-06-13T13:33:34Z"
mac: ENC[AES256_GCM,data:ij4HjVpnB8r67jsnVilXIIqutFMhsUG3tzuypEO9/JjtnpTtGxWgRD/LjMDRe8s4dx7E6e+U9m9CEtk+0kF8R3v16uq+JDxh/GPBMNI+AfuV6GIQvphDOpdMAnsHNDpFK2/M023L6cqWjhT12KONifyF+ezUKqzzHEfCpmuIF4k=,iv:vla5VknPn92ZZy2RejUQdwS+xlY8AsAV9Rtk13GgGXs=,tag:tAuvs0pokRTD6qxq6UXbpg==,type:str]
lastmodified: "2022-11-08T11:54:57Z"
mac: ENC[AES256_GCM,data:Q1u1tcYlN8MMrNSxAtADVD7hyYz6blKM2ODU8n5LjyNx4E2f7XiGqdly9T4H169QjIaMkHTs1kdd2zWnCTJVupDlVOwU2Znu13tNjUutzhYmBObFd2zXp15NLPD5vN4xLhwqVKTjVrylPq6i0pux06rWN0xMMgXaWduz/7pYV4A=,iv:vfpvGJ623lo8OWLuH7tdDY8Vc52LMblv7Ae7MaPzU8M=,tag:aO2q7JDIZpeH0+mj8Lp1Ig==,type:str]
pgp:
- created_at: "2022-05-21T04:35:09Z"
enc: |-
Expand Down Expand Up @@ -157,4 +158,4 @@ sops:
-----END PGP MESSAGE-----
fp: 1FD6667A0808D4D48BDB8757A61B48D8288FCF8A
encrypted_regex: ^(data|stringData)$
version: 3.5.0
version: 3.7.3
10 changes: 0 additions & 10 deletions argocd/argocd-notifications/README.md

This file was deleted.

53 changes: 0 additions & 53 deletions argocd/argocd-notifications/cm-patch.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions argocd/argocd-notifications/kustomization.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions argocd/argocd-notifications/secret-generator.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions argocd/argocd-notifications/service-monitor.yaml

This file was deleted.

1 change: 1 addition & 0 deletions argocd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ resources:
- applications/userdb-api.yaml
- applications/webirc.yaml
patches:
- argocd-notifications-cm.patch.yaml
- argo-cd-repo-server-ksops.patch.yaml
- argo-cd-allow-alpha-plugins.patch.yaml
- argo-cd-import-pgp-key.patch.yaml
Expand Down
6 changes: 6 additions & 0 deletions argocd/secret-generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ metadata:
name: argocd-ksops-secrets
files:
- ./argocd-secret.enc.yaml

# This secret contains
# - an API Key for bitbot
# - an API Key to `http://grafana.monitoring.svc/api`
- ./argocd-notifications-secret.enc.yaml

- ./deploy-key.enc.yaml
- ./ssh-key.enc.yaml

0 comments on commit 6cef9be

Please sign in to comment.