robusta-dev / kubewatch

Watch k8s events and trigger Handlers
Apache License 2.0
544 stars 79 forks source link

Add Custom Payload/Tags to Messages #58

Open RohitKochhar opened 10 months ago

RohitKochhar commented 10 months ago

For organizations running multiple clusters, right now if they were to implement kubewatch, they would likely need to open unique channels for each cluster and configure each individually so that they could discern the where the message is coming from.

For example, if you have dev, test and prod clusters, each with the same namespaces, and you get an alert saying that a secret was launched in the default namespace, how could you tell which cluster had the new secret launched.

By allowing custom tags, the user could add a field like:

customTags:
  cluster: prod

which would result in a message being sent that reads as:

kubewatch
A deployment in namespace `kubewatch` in the `my-cluster` cluster has been created:
kubewatch/kubewatch

tags:
- cluster: prod

This may be considered a duplicate of https://github.com/robusta-dev/kubewatch/issues/22, but this could also be used to write more custom information to the slack message.

I'd be happy to add this functionality, or alternatively the functionality outlined in the above related issue, I am making this issue to open a discussion of the best way to move forward.