https://github.com/zmalik/k8s-publisher
A simple k8s controller that publish messages on pod level based on annotations in slack channels
https://github.com/zmalik/k8s-publisher
events kubernetes pods slack
Last synced: 3 months ago
JSON representation
A simple k8s controller that publish messages on pod level based on annotations in slack channels
- Host: GitHub
- URL: https://github.com/zmalik/k8s-publisher
- Owner: zmalik
- License: mit
- Created: 2018-01-16T01:37:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-20T10:37:14.000Z (almost 7 years ago)
- Last Synced: 2024-12-06T20:19:43.006Z (5 months ago)
- Topics: events, kubernetes, pods, slack
- Language: Go
- Size: 382 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/zmalik/k8s-publisher)
# k8s-publisher
A simple kubernetes controller that watches pods for any changes and notify to sinks or trigger actions based on pods annotations
The idea behind k8s-publisher is to empower pod level custom channels, and avoid a super sink to aggregate all events of a kubernetes cluster. And make it easy a pod diagnostic in case of naive errors.
## Slack integration
The very first integration is with slack. You can define a slack channel to subscribe for a pod.
```
annotations:
# Tell k8s-publisher to send notifications of failure to slack #my-channel
notify-channels: |
[{"type":"slack", "value":"#my-channel"}]
```And the k8s-publisher takes care of publishing messages related to the pod to that channel.
## Http integration
The very first integration is with slack. You can define a slack channel to subscribe for a pod.
```
annotations:
# Tell k8s-publisher to send notifications of failure to endpoint
notify-channels: |
[{"type":"http", "value":"http://myendpoint.com/webhook"}]
```And the k8s-publisher takes care of publishing messages related to the pod to that channel.
## Installation
```
git clone https://github.com/zmalik/k8s-publisher.git
```edit the `deploy/deployment.yaml` file and add your slack-api-token
```
kubectl create -f deploy/deployment.yaml
```A k8s-publisher pod will run and keep an eye on all pods and keep checking for the `notify-channels` annotation.

## Work in Progress
This is a work in progress to add more integrations like stdout or email.