-
Notifications
You must be signed in to change notification settings - Fork 1.7k
in_kubernetes_events: support for net.* options including TCP keepalive settings #10487
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
base: master
Are you sure you want to change the base?
Conversation
including TCP keepalive Signed-off-by: Olaf Klischat <[email protected]>
0699d1b
to
5036307
Compare
Anything I can do here? I'm not sure what the failed test does, but I don't think it's caused by the PR change. |
@@ -218,7 +221,7 @@ struct k8s_events *k8s_events_conf_create(struct flb_input_instance *ins) | |||
flb_plg_info(ctx->ins, "API server: %s", ctx->kube_url); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something like this is necessary:
https://github.com/fluent/fluent-bit/blob/master/src/flb_input.c#L2126C5-L2126C27
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean I need to call this? No other plugin calls it, afaics. Is this the reason why the test fails? This isn't caused by the PR change, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is used in the in_event_test plugin here:
https://github.com/fluent/fluent-bit/blob/master/plugins/in_event_test/event_test.c#L331
the goal is to use the unified interface because it also make sure to cover the threaded vs no threaded mode
Support
net.*
options including TCP keepalive settings in thekubernetes_events
pluginThis allows the user to set net.* options in the
kubernetes_events
input plugin config. This is particularly useful for configuring TCP keepalive settings becausekubernetes_events
opens a watch on the Kubernetes API, which is a long-running connection that might see long periods of inactivity during which intermediate networking infrastructure like proxies might drop the connection silently. The Go K8s client sends keepalives automatically, e.g.kubectl get event -w
(which opens a watch on k8s events similar to thekubernetes_events
plugin) will send keepalives every 30s without the user having to configure anything (those will be HTTP/2 pings rather than raw zero-length TCP keepalives, but serves the same purpose).Testing
Before we can approve your change; please submit the following in a comment:
Sample config:
tcpdump extract:
Other config: Longer timeout (120s) to test reconnect
tcpdump:
As a consequence, fluent-bit recreates the connection and catches up on the events that might have happened in the meantime: