argo-cd
536 строк · 16.4 Кб
1apiVersion: v1
2data:
3template.app-created: |
4email:
5subject: Application {{.app.metadata.name}} has been created.
6message: Application {{.app.metadata.name}} has been created.
7teams:
8title: Application {{.app.metadata.name}} has been created.
9template.app-deleted: |
10email:
11subject: Application {{.app.metadata.name}} has been deleted.
12message: Application {{.app.metadata.name}} has been deleted.
13teams:
14title: Application {{.app.metadata.name}} has been deleted.
15template.app-deployed: |
16email:
17subject: New version of an application {{.app.metadata.name}} is up and running.
18message: |
19{{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} is now running new version of deployments manifests.
20slack:
21attachments: |
22[{
23"title": "{{ .app.metadata.name}}",
24"title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
25"color": "#18be52",
26"fields": [
27{
28"title": "Sync Status",
29"value": "{{.app.status.sync.status}}",
30"short": true
31},
32{
33"title": "Repository",
34"value": "{{.app.spec.source.repoURL}}",
35"short": true
36},
37{
38"title": "Revision",
39"value": "{{.app.status.sync.revision}}",
40"short": true
41}
42{{range $index, $c := .app.status.conditions}}
43{{if not $index}},{{end}}
44{{if $index}},{{end}}
45{
46"title": "{{$c.type}}",
47"value": "{{$c.message}}",
48"short": true
49}
50{{end}}
51]
52}]
53deliveryPolicy: Post
54groupingKey: ""
55notifyBroadcast: false
56teams:
57facts: |
58[{
59"name": "Sync Status",
60"value": "{{.app.status.sync.status}}"
61},
62{
63"name": "Repository",
64"value": "{{.app.spec.source.repoURL}}"
65},
66{
67"name": "Revision",
68"value": "{{.app.status.sync.revision}}"
69}
70{{range $index, $c := .app.status.conditions}}
71{{if not $index}},{{end}}
72{{if $index}},{{end}}
73{
74"name": "{{$c.type}}",
75"value": "{{$c.message}}"
76}
77{{end}}
78]
79potentialAction: |-
80[{
81"@type":"OpenUri",
82"name":"Operation Application",
83"targets":[{
84"os":"default",
85"uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}"
86}]
87},
88{
89"@type":"OpenUri",
90"name":"Open Repository",
91"targets":[{
92"os":"default",
93"uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
94}]
95}]
96themeColor: '#000080'
97title: New version of an application {{.app.metadata.name}} is up and running.
98template.app-health-degraded: |
99email:
100subject: Application {{.app.metadata.name}} has degraded.
101message: |
102{{if eq .serviceType "slack"}}:exclamation:{{end}} Application {{.app.metadata.name}} has degraded.
103Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.
104slack:
105attachments: |
106[{
107"title": "{{ .app.metadata.name}}",
108"title_link": "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
109"color": "#f4c030",
110"fields": [
111{
112"title": "Health Status",
113"value": "{{.app.status.health.status}}",
114"short": true
115},
116{
117"title": "Repository",
118"value": "{{.app.spec.source.repoURL}}",
119"short": true
120}
121{{range $index, $c := .app.status.conditions}}
122{{if not $index}},{{end}}
123{{if $index}},{{end}}
124{
125"title": "{{$c.type}}",
126"value": "{{$c.message}}",
127"short": true
128}
129{{end}}
130]
131}]
132deliveryPolicy: Post
133groupingKey: ""
134notifyBroadcast: false
135teams:
136facts: |
137[{
138"name": "Health Status",
139"value": "{{.app.status.health.status}}"
140},
141{
142"name": "Repository",
143"value": "{{.app.spec.source.repoURL}}"
144}
145{{range $index, $c := .app.status.conditions}}
146{{if not $index}},{{end}}
147{{if $index}},{{end}}
148{
149"name": "{{$c.type}}",
150"value": "{{$c.message}}"
151}
152{{end}}
153]
154potentialAction: |
155[{
156"@type":"OpenUri",
157"name":"Open Application",
158"targets":[{
159"os":"default",
160"uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}"
161}]
162},
163{
164"@type":"OpenUri",
165"name":"Open Repository",
166"targets":[{
167"os":"default",
168"uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
169}]
170}]
171themeColor: '#FF0000'
172title: Application {{.app.metadata.name}} has degraded.
173template.app-sync-failed: |
174email:
175subject: Failed to sync application {{.app.metadata.name}}.
176message: |
177{{if eq .serviceType "slack"}}:exclamation:{{end}} The sync operation of application {{.app.metadata.name}} has failed at {{.app.status.operationState.finishedAt}} with the following error: {{.app.status.operationState.message}}
178Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .
179slack:
180attachments: |
181[{
182"title": "{{ .app.metadata.name}}",
183"title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
184"color": "#E96D76",
185"fields": [
186{
187"title": "Sync Status",
188"value": "{{.app.status.sync.status}}",
189"short": true
190},
191{
192"title": "Repository",
193"value": "{{.app.spec.source.repoURL}}",
194"short": true
195}
196{{range $index, $c := .app.status.conditions}}
197{{if not $index}},{{end}}
198{{if $index}},{{end}}
199{
200"title": "{{$c.type}}",
201"value": "{{$c.message}}",
202"short": true
203}
204{{end}}
205]
206}]
207deliveryPolicy: Post
208groupingKey: ""
209notifyBroadcast: false
210teams:
211facts: |
212[{
213"name": "Sync Status",
214"value": "{{.app.status.sync.status}}"
215},
216{
217"name": "Failed at",
218"value": "{{.app.status.operationState.finishedAt}}"
219},
220{
221"name": "Repository",
222"value": "{{.app.spec.source.repoURL}}"
223}
224{{range $index, $c := .app.status.conditions}}
225{{if not $index}},{{end}}
226{{if $index}},{{end}}
227{
228"name": "{{$c.type}}",
229"value": "{{$c.message}}"
230}
231{{end}}
232]
233potentialAction: |-
234[{
235"@type":"OpenUri",
236"name":"Open Operation",
237"targets":[{
238"os":"default",
239"uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
240}]
241},
242{
243"@type":"OpenUri",
244"name":"Open Repository",
245"targets":[{
246"os":"default",
247"uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
248}]
249}]
250themeColor: '#FF0000'
251title: Failed to sync application {{.app.metadata.name}}.
252template.app-sync-running: |
253email:
254subject: Start syncing application {{.app.metadata.name}}.
255message: |
256The sync operation of application {{.app.metadata.name}} has started at {{.app.status.operationState.startedAt}}.
257Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .
258slack:
259attachments: |
260[{
261"title": "{{ .app.metadata.name}}",
262"title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
263"color": "#0DADEA",
264"fields": [
265{
266"title": "Sync Status",
267"value": "{{.app.status.sync.status}}",
268"short": true
269},
270{
271"title": "Repository",
272"value": "{{.app.spec.source.repoURL}}",
273"short": true
274}
275{{range $index, $c := .app.status.conditions}}
276{{if not $index}},{{end}}
277{{if $index}},{{end}}
278{
279"title": "{{$c.type}}",
280"value": "{{$c.message}}",
281"short": true
282}
283{{end}}
284]
285}]
286deliveryPolicy: Post
287groupingKey: ""
288notifyBroadcast: false
289teams:
290facts: |
291[{
292"name": "Sync Status",
293"value": "{{.app.status.sync.status}}"
294},
295{
296"name": "Started at",
297"value": "{{.app.status.operationState.startedAt}}"
298},
299{
300"name": "Repository",
301"value": "{{.app.spec.source.repoURL}}"
302}
303{{range $index, $c := .app.status.conditions}}
304{{if not $index}},{{end}}
305{{if $index}},{{end}}
306{
307"name": "{{$c.type}}",
308"value": "{{$c.message}}"
309}
310{{end}}
311]
312potentialAction: |-
313[{
314"@type":"OpenUri",
315"name":"Open Operation",
316"targets":[{
317"os":"default",
318"uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
319}]
320},
321{
322"@type":"OpenUri",
323"name":"Open Repository",
324"targets":[{
325"os":"default",
326"uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
327}]
328}]
329title: Start syncing application {{.app.metadata.name}}.
330template.app-sync-status-unknown: |
331email:
332subject: Application {{.app.metadata.name}} sync status is 'Unknown'
333message: |
334{{if eq .serviceType "slack"}}:exclamation:{{end}} Application {{.app.metadata.name}} sync is 'Unknown'.
335Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.
336{{if ne .serviceType "slack"}}
337{{range $c := .app.status.conditions}}
338* {{$c.message}}
339{{end}}
340{{end}}
341slack:
342attachments: |
343[{
344"title": "{{ .app.metadata.name}}",
345"title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
346"color": "#E96D76",
347"fields": [
348{
349"title": "Sync Status",
350"value": "{{.app.status.sync.status}}",
351"short": true
352},
353{
354"title": "Repository",
355"value": "{{.app.spec.source.repoURL}}",
356"short": true
357}
358{{range $index, $c := .app.status.conditions}}
359{{if not $index}},{{end}}
360{{if $index}},{{end}}
361{
362"title": "{{$c.type}}",
363"value": "{{$c.message}}",
364"short": true
365}
366{{end}}
367]
368}]
369deliveryPolicy: Post
370groupingKey: ""
371notifyBroadcast: false
372teams:
373facts: |
374[{
375"name": "Sync Status",
376"value": "{{.app.status.sync.status}}"
377},
378{
379"name": "Repository",
380"value": "{{.app.spec.source.repoURL}}"
381}
382{{range $index, $c := .app.status.conditions}}
383{{if not $index}},{{end}}
384{{if $index}},{{end}}
385{
386"name": "{{$c.type}}",
387"value": "{{$c.message}}"
388}
389{{end}}
390]
391potentialAction: |-
392[{
393"@type":"OpenUri",
394"name":"Open Application",
395"targets":[{
396"os":"default",
397"uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}"
398}]
399},
400{
401"@type":"OpenUri",
402"name":"Open Repository",
403"targets":[{
404"os":"default",
405"uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
406}]
407}]
408title: Application {{.app.metadata.name}} sync status is 'Unknown'
409template.app-sync-succeeded: |
410email:
411subject: Application {{.app.metadata.name}} has been successfully synced.
412message: |
413{{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} has been successfully synced at {{.app.status.operationState.finishedAt}}.
414Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .
415slack:
416attachments: |
417[{
418"title": "{{ .app.metadata.name}}",
419"title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
420"color": "#18be52",
421"fields": [
422{
423"title": "Sync Status",
424"value": "{{.app.status.sync.status}}",
425"short": true
426},
427{
428"title": "Repository",
429"value": "{{.app.spec.source.repoURL}}",
430"short": true
431}
432{{range $index, $c := .app.status.conditions}}
433{{if not $index}},{{end}}
434{{if $index}},{{end}}
435{
436"title": "{{$c.type}}",
437"value": "{{$c.message}}",
438"short": true
439}
440{{end}}
441]
442}]
443deliveryPolicy: Post
444groupingKey: ""
445notifyBroadcast: false
446teams:
447facts: |
448[{
449"name": "Sync Status",
450"value": "{{.app.status.sync.status}}"
451},
452{
453"name": "Synced at",
454"value": "{{.app.status.operationState.finishedAt}}"
455},
456{
457"name": "Repository",
458"value": "{{.app.spec.source.repoURL}}"
459}
460{{range $index, $c := .app.status.conditions}}
461{{if not $index}},{{end}}
462{{if $index}},{{end}}
463{
464"name": "{{$c.type}}",
465"value": "{{$c.message}}"
466}
467{{end}}
468]
469potentialAction: |-
470[{
471"@type":"OpenUri",
472"name":"Operation Details",
473"targets":[{
474"os":"default",
475"uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
476}]
477},
478{
479"@type":"OpenUri",
480"name":"Open Repository",
481"targets":[{
482"os":"default",
483"uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
484}]
485}]
486themeColor: '#000080'
487title: Application {{.app.metadata.name}} has been successfully synced
488trigger.on-created: |
489- description: Application is created.
490oncePer: app.metadata.name
491send:
492- app-created
493when: "true"
494trigger.on-deleted: |
495- description: Application is deleted.
496oncePer: app.metadata.name
497send:
498- app-deleted
499when: app.metadata.deletionTimestamp != nil
500trigger.on-deployed: |
501- description: Application is synced and healthy. Triggered once per commit.
502oncePer: app.status.operationState?.syncResult?.revision
503send:
504- app-deployed
505when: app.status.operationState != nil and app.status.operationState.phase in ['Succeeded']
506and app.status.health.status == 'Healthy'
507trigger.on-health-degraded: |
508- description: Application has degraded
509send:
510- app-health-degraded
511when: app.status.health.status == 'Degraded'
512trigger.on-sync-failed: |
513- description: Application syncing has failed
514send:
515- app-sync-failed
516when: app.status.operationState != nil and app.status.operationState.phase in ['Error',
517'Failed']
518trigger.on-sync-running: |
519- description: Application is being synced
520send:
521- app-sync-running
522when: app.status.operationState != nil and app.status.operationState.phase in ['Running']
523trigger.on-sync-status-unknown: |
524- description: Application status is 'Unknown'
525send:
526- app-sync-status-unknown
527when: app.status.sync.status == 'Unknown'
528trigger.on-sync-succeeded: |
529- description: Application syncing has succeeded
530send:
531- app-sync-succeeded
532when: app.status.operationState != nil and app.status.operationState.phase in ['Succeeded']
533kind: ConfigMap
534metadata:
535creationTimestamp: null
536name: argocd-notifications-cm
537