Giter Site home page Giter Site logo

notifications-engine's Introduction

Notifications Engine

Notifications Engine is a configuration-driven Golang library that provides notifications for cloud-native applications. The project provides integration with dozen of services like Slack, MS Teams, Mattermost, SMTP, Telegram, Netgenie, and the list keeps growing.

Why Use It?

The first class notifications support is often eschewed feature in Kubernetes controllers. This is challenging because notifications are very opinionated by nature. It is hard to predict what kind of events end-users want to be notified about and especially how the notification should look like. Additionally, there are lots of notification services so it is hard to decide which one to support first.The Notifications Engine is trying to tackle both challenges:

  • provides a flexible configuration-driven mechanism of triggers and templates and allows CRD controller administrators to accommodate end-user requirements without making any code changes;
  • out of the box integrates with dozen of notifications services (Slack, SMTP, Telegram etc) with many integrations yet to come;

Features

Using the engine CRD controller administrators can configure a set of triggers and templates and enable end-users to subscribe to the required triggers by just annotating custom resources they care about.

The example below demonstrates the Argo CD specific configuration:

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-notifications-cm
data:
  trigger.on-sync-status-unknown: |
    - when: app.status.sync.status == 'Unknown'
      send: [app-sync-status]

  template.app-sync-status: |
    message: |
      Application {{.app.metadata.name}} sync is {{.app.status.sync.status}}.
      Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.

  service.slack: |
    token: $slack-token
---
apiVersion: v1
kind: Secret
metadata:
  name: argocd-notifications-secret
stringData:
  slack-token: <my-slack-token>

The end-user can subscribe to the triggers they are interested in by adding notifications.argoproj.io/subscribe/<trigger>/<service>: <recipients> annotation:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  annotations:
    notifications.argoproj.io/subscribe.on-sync-succeeded.slack: my-channel1;my-channel2

If there is more than one trigger and multiple destinations you can configure the annotation as given below.

notifications.argoproj.io/subscriptions: |
  - trigger: [on-scaling-replica-set, on-rollout-updated, on-rollout-step-completed]
    destinations:
      - service: slack
        recipients: [my-channel-1, my-channel-2]
      - service: email
        recipients: [recipient-1, recipient-2, recipient-3 ]
  - trigger: [on-rollout-aborted, on-analysis-run-failed, on-analysis-run-error]
    destinations:
      - service: slack
        recipients: [my-channel-21, my-channel-22]

Getting Started

Ready to add notifications to your project? Check out sample notifications for cert-manager

Users

Additional Resources

notifications-engine's People

Contributors

dependabot[bot] avatar ryota-sakamoto avatar alexmt avatar pasha-codefresh avatar sergeyshevch avatar ravihari avatar lindhe avatar rodrigc avatar dlh avatar jsoref avatar emirot avatar ombratteng avatar sdowell avatar zachaller avatar adamdmharvey avatar lol3909 avatar bennesp avatar posquit0 avatar caseyscarborough avatar deathowl avatar rakhmanov avatar juneezee avatar erictendian avatar gokulav137 avatar jaredtbates avatar jason8399 avatar umi0410 avatar jocelynthode avatar kshamajain99 avatar jaygridley avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.