Set tcp keepalive for http connections
What is the feature and why do you need it:
Currently when a watch is opened to the kubernetes api we do not send regular keepalives on the connection. That means that if the watch is not receiving any updates a reverse proxy in the path might terminate the tcp connection.
The go client is currently sending a tcp keepalive every 30 seconds: https://github.com/kubernetes/client-go/blob/release-1.27/transport/cache.go#L104-L107
Describe the solution you'd like to see:
On linux set a socket options to update the keepalive time, just like it is done in go here: https://go.dev/src/net/tcpsockopt_unix.go
I do not have particular feelings regarding other operating systems
/help
@roycaihw: This request has been marked as needing help from a contributor.
Guidelines
Please ensure that the issue body includes answers to the following questions:
- Why are we solving this issue?
- To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
- Does this issue have zero to low barrier of entry?
- How can the assignee reach out to you for help?
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.
In response to this:
/help
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.