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 3c08261
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 98 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
49 changes: 49 additions & 0 deletions argocd/argocd-notifications-cm.patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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)"
File renamed without changes.
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 3c08261

Please sign in to comment.