Events on changed state
Closed this issue · 4 comments
This is really nice work, I'm glad I found this project!
I love being able to both make changes to ipvs without ipvsadm
, and query the state, but I'd also like to be able to get a notification when, for example, a third-party changes the state of the ipvs setup. Is this possible at the moment? At all? My kernel expertise in this area is minimal, and I don't know if Linux provides the ability to watch for such events.
The use case for this would be adding a set of resources for this into https://github.com/purpleidea/mgmt/ and if we had events, we wouldn't need to repeatedly poll to see if the state changed.
Thanks!
/cc @frebib
You don't see that in the package API because it's not possible. If you want to know about changes, you'll have to poll all services and destinations and detect the changes in your application.
The kernel does have a synchronization mechanism with the IPVS daemon and I looked into implementing a client. However, it only synchronizes the connection state and requires services and destinations to be preconfigured. (The protocol is also not documented for userspace, though it's probably relatively stable.)
This package connects with the IPVS module via (generic) netlink, which does have the ability to push messages to userspace clients: multicast messages. However, it's not implemented.
So I emailed a patch. In the event ( 🥁 ) it, or something similar, is implemented, I'll add support the the package.
That's extremely neat. Thank you for the excellent response. I think @jfindlay might also find this interesting so I am CC-ing. Cheers
get a notification when, for example, a third-party changes the state of the ipvs setup
Could you use eBPF for that?
I don't believe this is threaded to anything BPF would pick up on.