Git Product home page Git Product logo

slack8s's Introduction

Kubernetes Events Slack Bot (slack8s)

Kubernetes Slack Integration - Infinite loop go program which queries the Kubernetes Event Stream API and posts messages to slack for important events.

Slack8s demo showing creation of pod and then failed backoff loop alerts via Slack.

Building

Given this is an active work in progress, you'll probably want to modify and build the code yourself. If you just want to get started quickly, use the image in docker hub.

  1. docker build .
  2. Tag and push to your favorite registry

Running

  1. Create a new Slack Bot.
  2. Copy the example configmap file:
    cp examples/example.slack8s-configmap.yaml examples/slack8s-configmap.yaml
  3. Modify slack-token and slack-channel variables in your new file.
  4. Create the config map using kubectl:
    kubectl create -f examples/slack8s-configmap.yaml
  5. Create the slack8s deployment:
    kubectl create -f examples/slack8s-deployment.yaml

Limitations

  1. This does not keep track of which notifications it has sent. You should not trust that slack has every event.
  2. When the container dies, if the container takes more than 1 minute to spawn, some events will not be posted to slack.
  3. When the container dies, events within 1 minute of the restart will be posted to Slack twice.
  4. The watch api seems to hit EOF causing this container to die more often than desired. On a busy cluster, the above limitations are more obvious because of this.
  5. Do not attempt to use this as a replacement for a pager.

Todo

  1. Refactor the way in which the types of alerts to send to slack are configured
  2. Add more types of alerts which get posted to slack
  3. Better formatting of slack attachment output
  4. Alerting thresholds

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.