diff --git a/docs/design.md b/docs/design.md index 25da091b6..b389e9cd7 100644 --- a/docs/design.md +++ b/docs/design.md @@ -1,21 +1,29 @@ # Kubewatch -Kubewatch contains three components: client, config, handler +Kubewatch contains three components: controller, config, handler ![Kubewatch Diagram](kubewatch.png?raw=true "Kubewatch Overview") -## Client - -The client gets events from `kube-apiserver`, filtering and applying handler to event. - -It contains a config object and embedded with a k8s client. - ## Config The config object contains `kubewatch` configuration, like handlers, filters. A config object is used to creating new client. +## Controller + +The controller initializes using the config object by reading the `.kubewatch.yaml` or command line arguments. +If the parameters are not fully mentioned, the config falls back to read a set of standard environment variables. + +Controller creates necessary `SharedIndexInformer`s provided by `kubernetes/client-go` for listening and watching +resource changes. Controller updates this subscription information with Kubernetes API Server. + +Whenever, the Kubernetes Controller Manager gets events related to the subscribed resources, it pushes the events to +`SharedIndexInformer`. This in-turn puts the events onto a rate-limiting queue for better handling of the events. + +Controller picks the events from the queue and hands over the events to the appropriate handler after +necessary filtering. + ## Handler Handler manages how `kubewatch` handles events. @@ -23,10 +31,11 @@ Handler manages how `kubewatch` handles events. With each event get from k8s and matched filtering from configuration, it is passed to handler. Currently, `kubewatch` has 2 handlers: - `Default`: which just print the event in JSON format - - `Slack`: which send notification to Slack channel based on information from config + - `Flock`: which send notification to Flock channel based on information from config - `Hipchat`: which send notification to Hipchat room based on information from config - `Mattermost`: which send notification to Mattermost channel based on information from config - - `Flock`: which send notification to Flock channel based on information from config + - `MS Teams`: which send notification to MS Team incoming webhook based on information from config + - `Slack`: which send notification to Slack channel based on information from config More handlers will be added in future. diff --git a/docs/kubewatch.png b/docs/kubewatch.png index e0b5b80ee..c4b2d8635 100644 Binary files a/docs/kubewatch.png and b/docs/kubewatch.png differ