vmware-archive / kubewatch

Watch k8s events and trigger Handlers
Apache License 2.0
2.44k stars 442 forks source link

Multiple namespaces feature #242

Open luis-miguel-miranda opened 4 years ago

luis-miguel-miranda commented 4 years ago

This pull request contains a working version of multiple namespaces selection.

I've tried the code changes from PR 152. However this code resulted in multiple notifications for the same event and issues with inconsistency while adding several namespaces watchers. Here we create a thread per namespace when appropriate.

This feature is particularly helpful when you want to monitor a namespace of a cluster you are not admin as kubewatch allows that.

Note I am neither well versed on go nor spent a major amount of time on this. If the implementation sucks feel free to throw away. However the features have been working well in Openshift and AKS environments I use on and enterprise setting and may be useful for others.

nareshpandianpc commented 3 years ago

Can you merge this pr . We need to watch multiple namespaces in single pod or deployment