{"id":13561618,"url":"https://github.com/kubesphere/notification-manager","last_synced_at":"2025-05-16T03:04:32.403Z","repository":{"id":37830384,"uuid":"249754589","full_name":"kubesphere/notification-manager","owner":"kubesphere","description":"K8s native notification management with multi-tenancy support","archived":false,"fork":false,"pushed_at":"2025-04-28T08:23:08.000Z","size":2493,"stargazers_count":232,"open_issues_count":27,"forks_count":73,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-07T16:29:17.693Z","etag":null,"topics":["alertmanager","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kubesphere.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-03-24T16:06:57.000Z","updated_at":"2025-04-29T01:36:51.000Z","dependencies_parsed_at":"2023-12-11T06:54:18.376Z","dependency_job_id":"ffef5b67-d75d-4c9b-a611-e5a8a8387cb3","html_url":"https://github.com/kubesphere/notification-manager","commit_stats":{"total_commits":248,"total_committers":23,"mean_commits":"10.782608695652174","dds":0.657258064516129,"last_synced_commit":"0c0535ad034d7afb328cedd8b8348cab7f4f3d8c"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubesphere%2Fnotification-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubesphere%2Fnotification-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubesphere%2Fnotification-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubesphere%2Fnotification-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kubesphere","download_url":"https://codeload.github.com/kubesphere/notification-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253661189,"owners_count":21943878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alertmanager","kubernetes"],"created_at":"2024-08-01T13:00:59.213Z","updated_at":"2025-05-16T03:04:27.394Z","avatar_url":"https://github.com/kubesphere.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Notification Manager\n\u003cdiv align=center\u003e\u003cimg width=\"50%\" height=\"50%\" src=docs/images/logo.png/\u003e\u003c/div\u003e\n\n## Overview\n\nNotification Manager manages notifications in multi-tenant K8s environment. It receives alerts, cloud event, and others (such as auditing, k8s events) \nfrom different senders and then send notifications to various tenant receivers based on tenant label like `namespace` or `user`. \n\nSupported senders includes:\n- Prometheus Alertmanager\n- Custom sender\n- Prometheus  (Coming soon)\n- Cloud Event  (Coming soon)\n\nSupported receivers includes:\n- [DingTalk](https://www.dingtalk.com/en)\n- Email\n- [Feishu](https://www.feishu.cn/en/)  \n- [Pushover](https://pushover.net/)\n- SMS (Short Message Service)  \n- [Slack](https://slack.com/) \n- Webhook \n- [WeChat](https://work.weixin.qq.com/)\n- [Discord](https://discord.com/)\n\n## Architecture\n\nNotification Manager uses [Receiver](docs/crds/receiver.md) and [Config](docs/crds/config.md) CRDs to store notification configs\nlike email, WeChat and slack. It also includes an operator to create and reconcile [NotificationManager](docs/crds/notification-manager.md)\nCRD which watches all [receivers](docs/crds/receiver.md) and [configs](docs/crds/config.md), updates notification settings accordingly and sends notifications to users.\n\n![Architecture](docs/images/architecture.svg)\n\n## Process\n\nThe incoming data (alert, cloud event and others) will cache in the cache firstly, then goes through steps such as [silence](#silence), inhibit (coming soon), [route](#route), \n[filter](#filter), [aggregation](#aggregation), etc. Notifications will generate from data using [template](#customize-template), \nthen send to receivers and [history webhook](#history) (if set).\n\n![Architecture](docs/images/pipeline.svg)\n\n### Silence\n\n`Silence` is a straightforward way to simply mute notifications for a given time. It uses [Silence](docs/crds/silence.md) CRD to define\nthe silence policy. If incoming data matches an active silence, no notifications will be sent out for that data.\n\n### Route\n\n`Route` find all receivers the notifications will send to.\nThere are two ways to determine which receivers the notifications will send to, one is via [Router](docs/crds/router.md) CRD, \nand the other is auto-matching via the `namespace` label in the notification.\n\nUsually the incoming data contains a `namespace` label, Notification Manager uses this label to decide which receiver to use for sending notifications:\n- For KubeSphere, Notification Manager will try to find tenants with the right to access the namespace from [sidecar](docs/crds/notification-manager.md#tenant-sidecar)\n  and then find receivers with `user = xxx` label.\n- For Kubernetes, Notification Manager will try to find receivers with `namespace = xxx` label.\n\nFor data without a `namespace` label, for example alerts of node or kubelet, user can set up a receiver with `type = global` label to receive notifications without a `namespace` label. A global receiver sends notifications for all notifications received regardless any label. A global receiver usually set for an admin role.\n\nHow the two methods work together is determined by the [routePolicy](docs/crds/notification-manager.md#RoutePolicy).\n\n### Filter\n\n`Filter` filters the notifications sent to receivers. There are two ways to filter notifications. One is using [alertSelector](docs/crds/receiver.md#notification-filter) in the receiver,\nthe other is using [tenant silence](docs/crds/silence.md).\n\n### Aggregation\n\n`Aggregation` groups notifications by [groupLabels](docs/crds/notification-manager.md#grouplabels). Notifications in the same group will send together.\n\n### History\n\n`History` is a webhook used to collect all notifications sent to receivers, it can be set via [history](docs/crds/notification-manager.md#history).\n\n## QuickStart\n\n### Install\n\nWe assume you already have a Kubernetes cluster (v1.16+). You can install one using [KubeKey](https://github.com/kubesphere/kubekey) if you haven't.\n\n#### Install with yaml\n\n```shell\n# Deploy CRDs and the Notification Manager Operator:\nkubectl apply -f https://github.com/kubesphere/notification-manager/releases/download/v2.5.2/bundle.yaml\n# Deploy default template:\nkubectl apply -f https://github.com/kubesphere/notification-manager/releases/download/v2.5.2/template.yaml\n# Deploy built-in language packs.\nkubectl apply -f https://github.com/kubesphere/notification-manager/releases/download/v2.5.2/zh-cn.yaml\n```\n\n#### Install with helm\n\n```shell\nhelm install notification-manager --create-namespace -n kubesphere-monitoring-system https://github.com/kubesphere/notification-manager/releases/download/v2.5.2/notification-manager.tgz\n```\n\n### Configure NotificationManager \n\n[NotificationManager](docs/crds/notification-manager.md) CRD Defines the desired notification manager deployment. The Notification Manager Operator \nensures a deployment meeting the resource requirements is running. \n\nWe should create a NotificationManager CR first, skip this when using helm install.\n\n```shell\nkubectl apply -f https://github.com/kubesphere/notification-manager/releases/download/v2.5.2/notification_manager.yaml\n```\n\n### Configure sender\n\nNotification Manager uses port `19093` and API path `/api/v2/alerts` to receive alerts sent from Alertmanager.\n\n#### Config Alertmanager to send alerts to Notification Manager\n\nTo receive Alertmanager alerts, add webhook config like below to the `receivers` section of Alertmanager configuration file:\n\n```shell\n    \"receivers\":\n     - \"name\": \"notification-manager\"\n       \"webhook_configs\":\n       - \"url\": \"http://notification-manager-svc.kubesphere-monitoring-system.svc:19093/api/v2/alerts\"\n```\n\n#### Customize sender\n\nBelow is the data structure passed to the notification manager, please refer to [Data](https://github.com/kubesphere/notification-manager/blob/master/pkg/template/types.go#L12) for more details.\n\n```yaml\n{\n  \"alerts\": [\n    {\n      \"status\": \"firing\",\n      \"labels\": {\n        \"alertname\": \"KubePodCrashLooping\",\n        \"container\": \"busybox-3jb7u6\",\n        \"instance\": \"10.233.71.230:8080\",\n        \"job\": \"kube-state-metrics\",\n        \"namespace\": \"pp1\",\n        \"pod\": \"dd1-0\",\n        \"prometheus\": \"kubesphere-monitoring-system/k8s\",\n        \"severity\": \"critical\"\n      },\n      \"annotations\": {\n        \"message\": \"Pod pp1/dd1-0 (busybox-3jb7u6) is restarting 1.07 times / 5 minutes.\",\n      },\n      \"startsAt\": \"2020-02-26T07:05:04.989876849Z\",\n      \"endsAt\": \"0001-01-01T00:00:00Z\",\n    }\n  ],\n}\n```\n\nA custom senders can send notifications using notification manager simply by sending data to `http://notification-manager-svc.kubesphere-monitoring-system.svc:19093/api/v2/alerts`.\n\n### Create receiver and config\n\nNow it's time to create the receiver and config to receive notifications, you can find guides to create them in [receiver](docs/crds/receiver.md) and [config](docs/crds/config.md).\n\n### Customize template\n\nTo customize the notification template, please refer to [template](docs/template.md).\n\n## Development\n\n```\n# Build notification-manager-operator and notification-manager docker images\nmake build \n# Push built docker images to docker registry\nmake push\n```\n\n## Documentation\n\n- [API documentation](./docs/api/_index.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubesphere%2Fnotification-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkubesphere%2Fnotification-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubesphere%2Fnotification-manager/lists"}