-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in_kubernetes_events: Efficiently stream kubernetes events via watch #8351
Conversation
14b804c
to
f4093d7
Compare
@edsiper - just force pushed a new version of this. I still have this PR draft mode because it was branched off of 2 other PRs: #8316 & #8323. I was assuming it would be easier to review those each individually and then I'd rebase this one with a smaller set of changes to review, but if you'd prefer to just do them all in one change PR review/merge, I can move this pr to ready to review. |
f4093d7
to
8809b42
Compare
8639849
to
589a7cb
Compare
589a7cb
to
9e61635
Compare
Potentially breaking change as it now requires the rbac used by fluent-bit to have 'watch'. Uses a k8s watch instead of http api polling to stream k8s events from the kube api server Signed-off-by: ryanohnemus <[email protected]>
Signed-off-by: ryanohnemus <[email protected]>
Signed-off-by: ryanohnemus <[email protected]>
15cf21a
to
f526aa4
Compare
We probably should update docs as well, particularly with the RBAC change. Could you link a docs PR @ryanohnemus ? Do we have any int tests for this btw? |
fluent/fluent-bit#8351 Signed-off-by: ryanohnemus <[email protected]>
@patrick-stephens added doc via fluent/fluent-bit-docs#1396 No int tests, but I added unit tests for the plugin in this PR. |
* in_kubernetes_events: add k8s permission details fluent/fluent-bit#8351 Signed-off-by: ryanohnemus <[email protected]> * Update pipeline/inputs/kubernetes-events.md Co-authored-by: Adam Locke <[email protected]> Signed-off-by: Ryan Ohnemus <[email protected]> * Update pipeline/inputs/kubernetes-events.md Co-authored-by: Adam Locke <[email protected]> Signed-off-by: Ryan Ohnemus <[email protected]> * Add hard return to break section Signed-off-by: Adam Locke <[email protected]> --------- Signed-off-by: ryanohnemus <[email protected]> Signed-off-by: Ryan Ohnemus <[email protected]> Signed-off-by: Adam Locke <[email protected]> Co-authored-by: Adam Locke <[email protected]>
Change
in_kubernetes_events
plugin to watch kubernetes events after requesting the event list. Instead of polling for the full event list every 500ms (default), an initial full events list is requested and then is a watch is requested. The watch will create an efficient http chunked stream that will push events as they are added, modified, or deleted from the cluster. The interval_sec and interval_nsec plugin config options now act as a reconnect timer if the watch stream is ended, instead of timer to re-poll the k8s cluster.Potentially Breaking: this will require the kubernetes role used by fluent-bit to have
watch
permission in addition to the currentlist
andget
permissions.Fixes #8315
Leaving in draft as this is dependent on both #8316 & #8323, will rebase and move out of draft after those are reviewed/merged.
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.