airwallex / k8s-pod-restart-info-collector

Automated troubleshooting of Kubernetes Pods issues. Collect K8s pod restart reasons, logs, and events automatically.
314 stars 45 forks source link

Adding support for watchedNamespaces and watchedPodNamePrefixes #16

Closed tcyran closed 1 year ago

tcyran commented 1 year ago

Hey

I'm adding support for watchedNamespaces and watchedPodNamePrefixes which was requested in #14. It has reverse logic to ignore*

able8 commented 1 year ago

Thanks for your contribution. Sorry, we might not merge this PR since the ignoredNamespaces and watchedNamespaces seem duplicated.

tcyran commented 1 year ago

Thanks for your contribution. Sorry, we might not merge this PR since the ignoredNamespaces and watchedNamespaces seem duplicated.

Hey It introduced opposite logic. With ignoredNamespaces you're choosing which namespaces you don't want to "see" With watchedNamespaces you're choosing only those which you want to "see"

able8 commented 1 year ago

I see, but I'm concerned that supporting both ignoredNamespaces and watchedNamespaces may confuse users.

tcyran commented 1 year ago

I see, but I'm concerned that supporting both ignoredNamespaces and watchedNamespaces may confuse users.

Both can coexists and even be used together but I get your point. On the other hand if you have 100 namespaces and you want to observe only 5 of them setting ignoredNamespaces and updating it after every ns creation is painful. So maybe we can achieve it in some other way

tamcore commented 1 year ago

I'd vote for the inclusion: We have a few clusters with hundreds of namespaces, but we'd only need the information from 2 of them. It's not feasible to put every unwanted (dynamically provisioned, but long lived namespace) on the exclusion list. Having the option to just whitelist those 2 wanted namespaces would be great.

vaibhavjain882 commented 1 year ago

I'd also vote for inclusion. We have a use case where we want to monitor only one namespace out of hundreds of namespaces. @tcyran I will build a docker image from your changes and test it in my infrastructure.

jeremych1000 commented 1 year ago

Definitely need this! We run a cluster for many tenants which are dynamically created. We are using this to monitor our system namespaces - it's not realistic to have a 200 long ignore list!

jeremych1000 commented 1 year ago

I'd also vote for inclusion. We have a use case where we want to monitor only one namespace out of hundreds of namespaces. @tcyran I will build a docker image from your changes and test it in my infrastructure.

Did you push this image anywhere? :)

jeremych1000 commented 1 year ago

Alternatively - a label selector on namespaces, so I can ask to watch only namespaces with specific labels.

able8 commented 1 year ago

Thanks. We have added this feature, see https://github.com/airwallex/k8s-pod-restart-info-collector/blob/master/CHANGELOG.md#v140---2023-05-12