Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new event type "error" in config to watch error events on a resource #98

Merged
merged 5 commits into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go

go:
- 1.11
- 1.12

services:
- docker
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

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.
BotKube integration with Slack or Mattermost helps you monitor your Kubernetes cluster, debug critical deployments and gives recommendations for standard practices by running checks on the Kubernetes resources.
You can also ask BotKube to execute kubectl commands on k8s cluster which helps debugging an application or cluster.

![](botkube-title.jpg)

## Getting started
Please follow [this](https://www.botkube.io/installation/) for complete BotKube installation guide.
### 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

Expand Down Expand Up @@ -123,10 +124,8 @@ helm/botkube
- **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](https://www.botkube.io/installation/) for complete BotKube installation guide.
- **Event Notifier:** Finally, notifier sends BotKube event over the configured communication channel.
- **Bot Interface:** Bot interface takes care of authenticating and managing connections with communication mediums like Slack, Mattermost. It reads/sends messages from/to commucation mediums.
- **Executor:** Executes BotKube or kubectl command and sends back the result to the Bot interface.

Visit www.botkube.io for Configuration, Usage and Examples.
Binary file modified botkube_arch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 18 additions & 7 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,112 +3,123 @@ resources:
- name: pods # Name of the resources e.g pods, deployments, ingresses, etc. (Resource name must be in plural form)
namespaces: # List of namespaces, "all" will watch all the namespaces
- all
events: # List of lifecycle events you want to receive, e.g create, update, delete OR all
events: # List of lifecycle events you want to receive, e.g create, update, delete, error OR all
- create
- delete
- error
- name: services
namespaces:
- all
events:
- create
- delete
- error
- name: deployments
namespaces:
- all
events:
- create
- delete
- error
- name: ingresses
namespaces:
- all
events:
- create
- delete
- error
- name: nodes
namespaces:
- all
events:
- create
- delete
- error
- name: namespaces
namespaces:
- all
events:
- create
- delete
- error
- name: persistentvolumes
namespaces:
- all
events:
- create
- delete
- error
- name: persistentvolumeclaim
namespaces:
- all
events:
- create
- delete
- error
- name: secrets
namespaces:
- all
events:
- create
- delete
- error
- name: configmaps
namespaces:
- all
events:
- create
- delete
- error
- name: daemonsets
namespaces:
- all
events:
- create
- delete
- error
- name: jobs
namespaces:
- all
events:
- create
- delete
- error
- name: roles
namespaces:
- all
events:
- create
- delete
- error
- name: rolebindings
namespaces:
- all
events:
- create
- delete
- error
- name: clusterroles
namespaces:
- all
events:
- create
- delete
- error
- name: clusterrolebindings
namespace:
- all
events:
- create
- delete
- error
- name: nodes
namespaces:
- all
events:
- create
- delete
- error

# K8S error/warning events you want to receive for the configured resources
events:
types:
#- normal
- warning

# Check true if you want to receive recommendations
# about the best practices for the created resource
recommendations: true
Expand Down
25 changes: 18 additions & 7 deletions deploy-all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,111 +13,122 @@ data:
- name: pods # Name of the resources e.g pods, deployments, ingresses, etc. (Resource name must be in plural form)
namespaces: # List of namespaces, "all" will watch all the namespaces
- all
events: # List of lifecycle events you want to receive, e.g create, update, delete OR all
events: # List of lifecycle events you want to receive, e.g create, update, delete, error OR all
- create
- delete
- error
- name: services
namespaces:
- all
events:
- create
- delete
- error
- name: deployments
namespaces:
- all
events:
- create
- delete
- error
- name: ingresses
namespaces:
- all
events:
- create
- delete
- error
- name: nodes
namespaces:
- all
events:
- create
- delete
- error
- name: namespaces
namespaces:
- all
events:
- create
- delete
- error
- name: persistentvolumes
namespaces:
- all
events:
- create
- delete
- error
- name: persistentvolumeclaims
namespaces:
- all
events:
- create
- delete
- error
- name: secrets
namespaces:
- all
events:
- create
- delete
- error
- name: configmaps
namespaces:
- all
events:
- create
- delete
- error
- name: daemonsets
namespaces:
- all
events:
- create
- delete
- error
- name: jobs
namespaces:
- all
events:
- create
- delete
- error
- name: roles
namespaces:
- all
events:
- create
- delete
- error
- name: rolebindings
namespaces:
- all
events:
- create
- delete
- error
- name: clusterroles
namespaces:
- all
events:
- create
- delete
- error
- name: clusterrolebindings
namespace:
- all
events:
- create
- delete
- error
- name: nodes
namespaces:
- all
events:
- create
- delete

# K8S error/warning events you want to receive for the configured resources
events:
types:
#- normal
- warning
- error

# Check true if you want to receive recommendations
# about the best practices for the created resource
Expand Down
15 changes: 3 additions & 12 deletions hack/verify-govet.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail
set -x

find_files() {
find . -not \( \
\( \
-wholename '*/vendor/*' \
\) -prune \
\) -name '*.go'
}

find_files | xargs -I@ bash -c "go tool vet @"
go vet ./pkg/...
go vet ./cmd/...
Loading