robusta-dev / kubewatch

Watch k8s events and trigger Handlers
Apache License 2.0
630 stars 87 forks source link

Ingress cannot be watched in k8s 1.22+ #34

Closed olivierboucher closed 1 year ago

olivierboucher commented 1 year ago

Hi,

Accessing ingresses through extensions/v1beta1 is no longer possible since 1.22. Deprecation notice

This means that the following code has to start using networking.k8s.io/v1

https://github.com/robusta-dev/kubewatch/blob/55493a566b5c1ec65af7459e3ca7ed443d40b320/pkg/controller/controller.go#L494

However, by doing so we are breaking ingress support for people running 1.18 and lower.

Since people should have moved on from 1.18 a long time ago, I think it's fair enough to proceed.

Let me know and I can open a pull request pretty quickly

arikalon1 commented 1 year ago

Thanks for reporting it @olivierboucher

Will this change fail on older k8s versions, or the old Ingresses will just be ignored?

olivierboucher commented 1 year ago

Not sure of the exact behavior, I would test it but it's not possible to spawn clusters with 1.18 or lower on GKE anymore.

I don't know if the networking.k8s.io/v1 existed then.

arikalon1 commented 1 year ago

Got it.

Please create the pr. Maybe we can test it on kind cluster or similar

olivierboucher commented 1 year ago

@arikalon1 There you go. I was surprised to see that the dependency was so far behind.

arikalon1 commented 1 year ago

Thanks @olivierboucher I'll review it shortly

arikalon1 commented 1 year ago

released in 2.3