github.com/argoproj-labs/argocd-operator@v0.10.0/config/samples/argoproj.io_v1alpha1_notificationsconfiguration.yaml (about)

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