kubewatch icon indicating copy to clipboard operation
kubewatch copied to clipboard

Enhance Config (.kubewatch.yaml) for granular alerting

Open codenio opened this issue 6 years ago • 11 comments

This PR

  • Adds "Event" config section in the .kubewatch.yaml file for granular alerting
  • Makes Event config optional
  • Makes Resource config optional for backward compatibility
  • Enables configuration of alerts either using the "Resource" config or "Event" Config
  • Renames "Services" option to "Service" option in .kubewatch.yaml file
  • Populates Namespace details from events key, if the Namespace filed is empty

Upon Merging

  • Enables the user to customize alerts based on the Event configuration provided. eg: pod - alerts on creation and deletion events can be configured. svc - alerts on deletion can be configured individually.

Example Configs:

Using Resource Config:

$ cat ~/.kubewatch.yaml
handler:
  slack:
    token: xoxb-xxxxxxxxx-yyyyyyyyyy
    channel: kube-watch-test
resource:
  deployment: false
  replicationcontroller: false
  replicaset: false
  daemonset: false
  service: true
  pod: true
  job: false
  persistentvolume: false
  namespace: false
  secret: false
  configmap: false
  ingress: false
namespace: ""

Using Resource Config Sends all events to the specified channel. Note: This section is kept unchanged for backward compatibility.

Using Event Config:

$ cat ~/.kubewatch.yaml 
handler:
  slack:
    token: xoxb-xxxxx-yyyyyyy
    channel: kube-watch-test

event:
    global:                       // global section alerts for all events
     - pod
     - deployment
    create:                       // create section alerts for resource object creation
     - service
    update:                       // update section for resource object updation
     - 
    delete:                       // delete section alerts for resource object deletion
     - job
     - service

namespace: ""

Using Event Config

  • all events for pod and deployment
  • create and delete events for service
  • delete events for job

will be sent to the specified channel.

This PR addresses Issue #105 and #163.

I would like to discuss on this PR and get it merged with peer reviews and feedbacks.

codenio avatar Jun 07 '19 17:06 codenio

@tylerauerbeck, @jbianquetti-nami, @jjo
do help with your views, comments, and feedbacks.

codenio avatar Jun 07 '19 17:06 codenio

We could discuss on this feature (when people are free) for improvements like,

  • labels and selectors for monitoring parricular resources
  • annotation based alerting
  • ~~default alerts on critical events like node reboot ,node not ready~~ (proposed through #179 )

Altering the current config suitably, would support customisation.

codenio avatar Jun 17 '19 16:06 codenio

def want this + label selectors to further target specific things to monitor

bitsofinfo avatar Jul 02 '19 20:07 bitsofinfo

Remider Ping Could this be reviewed and merged..?

codenio avatar Jul 10 '19 06:07 codenio

  • annotation based alerting
  • alerts on critical events like node reboot ,node not ready

Altering the current config suitably, would support customisation.

FYI, These features are now avalilable with Botkube (0.9.0) People in need can make use of it. :+1:

codenio avatar Oct 11 '19 12:10 codenio

Botkube lack other features (like Teams integration), i hope that this PR will be merged since i think that it will be useful for a lot of users: now even on small k8s deployment, a small activity like a deployment or a scaleup, create a lot of notifications (6 or more) ... this makes the notifications unreadable and mute-prone

davidegiunchi avatar May 03 '20 15:05 davidegiunchi

rebased into master

codenio avatar Jul 03 '20 04:07 codenio

conflicts

mkmik avatar Jul 06 '20 14:07 mkmik

resolved conflicts and rebased into the master

codenio avatar Jul 07 '20 04:07 codenio

@mkmik rebased into master

codenio avatar Jul 08 '20 06:07 codenio

Any news on this?

ypicard avatar Nov 19 '21 19:11 ypicard