Problem
Initial list of Events is expensive for large clusters. Even though the current watcher clears list.Items to avoid local buffering, the apiserver still has to produce and transmit the full list before the watch starts. This delays readiness and increases API load when event volume is high.
Proposed optimization
Use watchlist semantics (SendInitialEvents + watch bookmarks) so the initial state is streamed over watch and ends with a bookmark. This avoids large list bursts and provides a clean sync point for the watcher.
Notes / references
Acceptance criteria
- Event watcher uses watchlist for initial sync and handles bookmark completion.
- Startup time and apiserver request volume are reduced vs. full list on large clusters.
- Fallback to list/watch remains in place for clusters that do not support watchlist.
Problem
Initial list of Events is expensive for large clusters. Even though the current watcher clears
list.Itemsto avoid local buffering, the apiserver still has to produce and transmit the full list before the watch starts. This delays readiness and increases API load when event volume is high.Proposed optimization
Use watchlist semantics (SendInitialEvents + watch bookmarks) so the initial state is streamed over watch and ends with a bookmark. This avoids large list bursts and provides a clean sync point for the watcher.
Notes / references
metav1.ListOptions:AllowWatchBookmarks,SendInitialEvents,ResourceVersionMatch=NotOlderThank8s.io/client-go/tools/cache/reflector.go)Acceptance criteria