jsenon / k8sslackevent

Watch k8s event and publish to slack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

K8S Event Watcher

CircleCI Go Report Card

An event watcher for Kubernetes Environment, and publish on slack

Func

  • Pod Event Watcher on default and kube-system namespace
  • Node Event Watcher
  • Event Watcher
  • Publisher on slack
  • Watch OOMKilled Event and retrieve pod name
  • External or Internal k8s api

Build

Usage

Right now pod watcher is available on default and kube-system namespaces

Create Webhook slack application and export URL

export SLACK_URL=https://hooks.slack.com/xxx

For internal k8s:

k8sslackevent serve --api internal

For External k8s, its based on current context in your .kube/config file:

k8sslackevent serve --api external

Env

  • SLACK_URL = Slack URL Hook

TIPS

If you receive cannot execute binary file: Exec format error

Compile with CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go

And build docker build -t jsenon/k8sslackevent:vx.x .

TODO

  • Specify Pod watcher namespace as flag
  • Add Event bus integration

About

Watch k8s event and publish to slack

License:Apache License 2.0


Languages

Language:Go 88.4%Language:Makefile 10.4%Language:Dockerfile 1.2%