-
Notifications
You must be signed in to change notification settings - Fork 576
OCPBUGS-61858: Add HTTPKeepAliveTimeout to IngressController API #2547
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1884,6 +1884,31 @@ type IngressControllerTuningOptions struct { | |
| // +optional | ||
| ConnectTimeout *metav1.Duration `json:"connectTimeout,omitempty"` | ||
|
|
||
| // httpKeepAliveTimeout defines the maximum allowed time to wait for | ||
| // a new HTTP request to appear on a connection from the client to the router. | ||
| // | ||
| // This field expects an unsigned duration string of decimal numbers, each with optional | ||
| // fraction and a unit suffix, e.g. "300ms", "1.5h" or "2h45m". | ||
| // Valid time units are "ns", "us" (or "µs" U+00B5 or "μs" U+03BC), "ms", "s", "m", "h". | ||
| // | ||
| // When omitted, this means the user has no opinion and the platform is left | ||
| // to choose a reasonable default. This default is subject to change over time. | ||
| // The current default is 300s. | ||
| // | ||
| // Low values (milliseconds or less) can cause clients to close and reopen connections | ||
| // for each request, leading to reduced connection sharing. | ||
| // For HTTP/2, special care should be taken with low values. | ||
| // A few seconds is a reasonable starting point to avoid holding idle connections open | ||
| // while still allowing subsequent requests to reuse the connection. | ||
| // | ||
| // High values (minutes or more) favor connection reuse but may cause idle | ||
| // connections to linger longer. | ||
| // | ||
| // +kubebuilder:validation:Pattern=^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. // +kubebuilder:validation:Format=duration does this works instead? spotted it on other field above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, the duration validation is not aligned in the tuning options. I used the explicit regex for a reason that some kubebuilder's duration != golang's duration. We have a bug which showcases this for the client timeout. |
||
| // +kubebuilder:validation:Type:=string | ||
| // +optional | ||
| HTTPKeepAliveTimeout *metav1.Duration `json:"httpKeepAliveTimeout,omitempty"` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note We prefer not to use duration values anymore. Instead, we would create a Referring linter: kubernetes-sigs/kube-api-linter#24 We have a bunch of other There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think this makes sense for new APIs (or new fields of existing APIs). But here I'm thinking of the consistency in the scope of the same API field. All other timeouts we have in |
||
|
|
||
| // tlsInspectDelay defines how long the router can hold data to find a | ||
| // matching route. | ||
| // | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 adding a section starting with "// Setting this field is generally not recommended..." is always helpful. We have it on most of the other tuning options to help people understand the consequence of changing the default value, with explanation for what happens if you set it too high (idle connections remain open longer and use unnecessary resources?), and what happens if you set it too low (idle connection could be closed sooner than wanted and interrupt traffic?).
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 cannot say that it's "not recommended". It's a prerogative of a customer, that's why we had an RFE fo it. I can elaborate on corner cases though.
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 added 2 "paragraphs" about the potential impact of setting low and high values.