robusta-dev / kubewatch

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

Support for multiple namespace #80

Open amandpay opened 2 days ago

amandpay commented 2 days ago

Hi , Is multiple namespace supported ? I can see option to add either on or leave empty to watch all namespaces.

I have deployed kubewatch using helm. And i want resources which are namespace based to be watched from few namespace only.

arikalon1 commented 1 day ago

hey @amandpay

As you said, kubewatch support only watching a specific namespace, or all. One option is to install kubewatch instance in each namespace you want to watch. Another option is to install Robusta which include kubewatch, and to the namespace filtering in Robusta

At the moment we don't plan to add the option to monitor multiple namespace directly in kubewatch

amandpay commented 1 day ago

Hi @arikalon1 Thanks for the update. Does Robusta supports node monitoring ?

I would like to use without Prometheus. 1.Like if any node is not ready will it send alert ? 2.Also is this free of cost ? 3.I want to also control events ?

arikalon1 commented 1 day ago

Hey @amandpay

You can use Robusta without Prometheus. We have an action in Robusta named node_health_watcher It sends a notification each time the node status is changed from Ready to Not Ready and vice versa. We found it to be too spammy, and send too many notifications, so we removed it from the docs.

If you want still try it, add this custom playbook to Robusta:

customPlaybooks:
- triggers:
    - on_node_update: {}
  actions:
    - node_health_watcher: {}

I personally think Prometheus is a better way to monitor it, because it alerts for issues that only persists for more than X minutes.

amandpay commented 1 day ago

How can we mention multiple namespace to watch resource from only namespace1 and namespace2 ?

arikalon1 commented 1 day ago

In Robusta, you can define to send only notifications coming from a list of namespaces

It will not work for the above playbook, because Node is not a namespaced resource (It doesn't belong to a single namespace)

amandpay commented 1 day ago

That i got it. I want node alerts as well and pod alerts from few namespaces.

Can you share some example ?

arikalon1 commented 1 day ago

In Robusta, the destinations are called Sinks For each Sink you can define the scope of it. You can read more about sinks scopes here

Your scope should include any message coming from a list of namespaces, on those from the node_health_watcher

Should be something like:

sinksConfig:
- slack_sink:
   ...
   scope:
     include:
     - namespace:  # this matches notifications from namespace1 or namespace2
       - namespace1
       - namespace2
     - identifier: NodeNotReady  # this matches the unhealthy nodes notifications
amandpay commented 1 day ago

Got it thanks.

Values.yaml says the below note

NOTE: Do not use this file to install Robusta. It has missing values that need to be filled in. See the installation instructions instead https://docs.robusta.dev/master/installation.html

How can add customPlaybooks then ?

Also i want to change few more configs like restart_count etc. How can I ?