krkn-chaos / cerberus

Guardian of Kubernetes clusters. Tool to monitor clusters health and signal/alert on failures.
Apache License 2.0
92 stars 41 forks source link

Is it possible to exclude a specific ClusterOperator? #187

Open stratus-ss opened 2 years ago

stratus-ss commented 2 years ago

I have a scenario where I have a specific cluster operator that I want to exclude. For example openshift-samples is it possible to ignore a specific operator?

I know you can disable all cluster operator watching, but there are scenarios where a few operators might fail, and that might be ok depending on the environment. For example, insights, marketplace, and openshift-samples are not required to have a functioning cluster.

Thanks

chaitanyaenr commented 2 years ago

Hi @stratus-ss, thanks for creating the issue! The use case that you mentioned is very much valid, we will work on adding the functionality in Cerberus to filter/skip operators based on name/regex. Please feel free to let us know if you would like to add the enhancement. Thanks.

stratus-ss commented 2 years ago

I might be able to do a PR for this. I'd be starting from scratch for this code base. Any avenues to look at would be appreciated

chaitanyaenr commented 2 years ago

@stratus-ss sure thing. We need to tweak the config to accept a list with regex pattern(s) from user here - https://github.com/redhat-chaos/cerberus/blob/main/config/config.yaml#L6 and skip them from monitoring in the function here - https://github.com/redhat-chaos/cerberus/blob/main/cerberus/kubernetes/client.py#L350.

Here is a sample PR which does something similar for namespace monitoring - https://github.com/redhat-chaos/cerberus/pull/178.

Please feel free to let us know in case of any questions and we are more than happy to help!