kubewatch icon indicating copy to clipboard operation
kubewatch copied to clipboard

[feature] Support watch any k8s resource

Open Colvin-Y opened this issue 1 year ago • 3 comments

User may want to watch their own crd objects, like advanced-statefulset in openkruise. Current object types is too few.\

Actually, if user config kube-watch controller rbac correcly, we can use k8s.io/client-go/dynamic/dynamicinformer to watch any unstructured object if we know it's gvk info (resources can be found by discovery client)\

By this implementation, pkg/controller/controller.go::Start() function will be more short and clear. We can remove so many if conf.Resource.XXX branch.

Colvin-Y avatar Jun 27 '24 12:06 Colvin-Y

Hi @Colvin-Y, can you try this branch and let me know how it works for you?

https://github.com/robusta-dev/kubewatch/pull/76

aantn avatar Jun 27 '24 12:06 aantn

Hi @Colvin-Y, can you try this branch and let me know how it works for you?

#76 Hi @aantn, Uhuh,nice PR! implementation is same as what I think. I'd like to try it recently, may this weekend.
Btw, why dont'u refactor controller.go to tidy so many if conf.Resource.XXX case. \

Colvin-Y avatar Jun 27 '24 12:06 Colvin-Y

Yes, I think it it possible. It is quite an eyesore right now.

aantn avatar Jun 27 '24 13:06 aantn

Now supported in the latest version!

aantn avatar Aug 19 '24 08:08 aantn