An app that helps you monitor your Kubernetes cluster, debug critical deployments & gives recommendations for standard practices
Go to file
mugdha-adhav 661083777c Added git tag and docker images versioning support with Makefile.
Updated travis to use Makefile.
Removed @botkube help commands.
2019-03-06 16:23:01 +05:30
.github/ISSUE_TEMPLATE Update issue templates 2019-03-01 14:19:49 +05:30
build Added git tag and docker images versioning support with Makefile. 2019-03-06 16:23:01 +05:30
cmd/botkube Rename kubeops to botkube 2019-01-03 17:37:20 +05:30
design Issue #37: Added multi-cluster support for displaying cluster specific information. 2019-03-06 15:12:49 +05:30
hack Add verify-gofmt, update-gofmt, verify-golint and verify-govet scripts 2018-12-31 11:09:58 +05:30
helm/botkube Added git tag and docker images versioning support with Makefile. 2019-03-06 16:23:01 +05:30
pkg Added git tag and docker images versioning support with Makefile. 2019-03-06 16:23:01 +05:30
vendor Add vendoring 2018-12-26 13:12:17 +05:30
.release Added git tag and docker images versioning support with Makefile. 2019-03-06 16:23:01 +05:30
.travis.yml Added git tag and docker images versioning support with Makefile. 2019-03-06 16:23:01 +05:30
botkube_arch.jpg Add botkube arch diagram 2019-01-24 16:58:46 +05:30
botkube-title.jpg Added image 2019-01-24 15:23:48 +05:30
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2019-03-01 14:25:34 +05:30
config.yaml Issue #37: Added multi-cluster support for displaying cluster specific information. 2019-03-06 15:12:49 +05:30
deploy-all-in-one.yaml Add yaml specs to deploy with kubectl command 2019-01-15 15:12:04 +05:30
Gopkg.lock Add vendoring 2018-12-26 13:12:17 +05:30
Gopkg.toml Fix typo and remove redundant comments 2018-12-31 11:48:13 +05:30
LICENSE Add MIT license 2019-01-16 00:16:41 +05:30
Makefile Added git tag and docker images versioning support with Makefile. 2019-03-06 16:23:01 +05:30
README.md Add arch diagram in README 2019-01-24 17:39:11 +05:30

BotKube

Build Status Go Report Card

For complete documentation visit www.botkube.io

A Slack bot which keeps eye on your Kubernetes resources and notifies about resources life cycles events, errors and warnings. It allows you to define and run certain checks on resouces specs. You can also ask BotKube to execute kubectl commands on k8s cluster which helps debugging an application or cluster.

Getting started

Install BotKube app to your Slack workspace

Click the "Add to Slack" button provided to install BotKube Slack application to your workspace. Once you authorized the application, you will be provided a BOT Access token. Kindly note down that token which will be required while deploying BotKube controller to your cluster

Add to Slack

Add BotKube to a Slack channel

After installing BotKube app to your Slack workspace, you could see new bot user with name 'BotKube' create in your workspace. Add that bot to a Slack channel you want to receive notification in. (You can add it by inviting using @BotKube message in a required channel)

Installing BotKube controller to your Kubernetes cluster

Using helm

  • We will be using helm to install our k8s controller. Follow this guide to install helm if you don't have it installed already
  • Clone the BotKube github repository.
$ git clone https://github.com/infracloudio/botkube.git
  • Update default config in helm/botkube/values.yaml to watch the resources you want. (by default you will receive create, delete and error events for all the resources in all the namespaces.) If you are not interested in events about particular resource, just remove it's entry from the config file.
  • Deploy BotKube controller using helm install in your cluster.
$ helm install --name botkube --namespace botkube --set config.communications.slack.channel={SLACK_CHANNEL_NAME},config.communications.slack.token={SLACK_API_TOKEN_FOR_THE_BOT},config.settings.clustername={CLUSTER_NAME},config.settings.allowkubectl={ALLOW_KUBECTL} helm/botkube/

where,
SLACK_CHANNEL_NAME is the channel name where @BotKube is added
SLACK_API_TOKEN_FOR_THE_BOT is the Token you received after installing BotKube app to your Slack workspace
CLUSTER_NAME is the cluster name set in the incoming messages
ALLOW_KUBECTL set true to allow kubectl command execution by BotKube on the cluster

Configuration syntax is explained here

  • Send @BotKube ping in the channel to see if BotKube is running and responding.

Using kubectl

  • Make sure that you have kubectl cli installed and have access to Kubernetes cluster
  • Download deployment specs yaml
$ wget -q https://raw.githubusercontent.com/infracloudio/botkube/master/deploy-all-in-one.yaml
  • Open downloaded deploy-all-in-one.yaml and update the configuration. Set SLACK_CHANNEL, SLACK_API_TOKEN, clustername, allowkubectl and update the resource events configuration you want to receive notifications for in the configmap.

    where,
    SLACK_CHANNEL is the channel name where @BotKube is added
    SLACK_API_TOKEN is the Token you received after installing BotKube app to your Slack workspace
    clustername is the cluster name set in the incoming messages
    allowkubectl set true to allow kubectl command execution by BotKube on the cluster

    Configuration syntax is explained here

  • Create botkube namespace and deploy resources

$ kubectl create ns botkube && kubectl create -f deploy-all-in-one.yaml -n botkube
  • Check pod status in botkube namespace. Once running, send @BotKube ping in the Slack channel to confirm if BotKube is responding correctly.

Architecture

  • Informer Controller: Registers informers to kube-apiserver to watch events on the configured k8s resources. It forwards the incoming k8s event to the Event Manager
  • Event Manager: Extracts required fields from k8s event object and creates a new BotKube event struct. It passes BotKube event struct to the Filter Engine
  • Filter Engine: Takes the k8s object and BotKube event struct and runs Filters on them. Each filter runs some validations on the k8s object and modifies the messages in the BotKube event struct if required.
  • Notifier: Finally, notifier sends BotKube event over the configured communication channel.
  • Slack RTM Client: Slack RTM API authenticates and connects to the Slack messaging server. It parses and forwards the incoming message to Executer.
  • Executor: Executes notifier or kubectl command and sends back the result to the RTM client.

Follow this for complete BotKube installation guide.

Visit www.botkube.io for Configuration, Usage and Examples.