Skip to content

Commit

Permalink
Graduate GEP-2257 and GEP-1742 to standard (#3210)
Browse files Browse the repository at this point in the history
* Graduate GEP-1742 and GEP-2257 to standard

Signed-off-by: Flynn <emissary@flynn.kodachi.com>

* Fix typos in GEP-1742

Signed-off-by: Flynn <emissary@flynn.kodachi.com>

* Tweak GEP-2257 language around repeated units to no longer claim that 2257 is experimental.

Signed-off-by: Flynn <emissary@flynn.kodachi.com>

* Mention GEP-2257 in CRD docstrings, and clarify that behavior for a missing backendRequest timeout is implementation-specific.

Signed-off-by: Flynn <emissary@flynn.kodachi.com>

* make generate

Signed-off-by: Flynn <emissary@flynn.kodachi.com>

---------

Signed-off-by: Flynn <emissary@flynn.kodachi.com>
  • Loading branch information
kflynn committed Aug 9, 2024
1 parent 37b3035 commit a311340
Show file tree
Hide file tree
Showing 9 changed files with 282 additions and 42 deletions.
10 changes: 6 additions & 4 deletions apis/v1/httproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ type HTTPRouteRule struct {
// Support: Extended
//
// +optional
// <gateway:experimental>
Timeouts *HTTPRouteTimeouts `json:"timeouts,omitempty"`

// SessionPersistence defines and configures session persistence
Expand Down Expand Up @@ -322,7 +321,8 @@ type HTTPRouteTimeouts struct {
// request stream has been received instead of immediately after the transaction is
// initiated by the client.
//
// When this field is unspecified, request timeout behavior is implementation-specific.
// The value of Request is a Gateway API Duration string as defined by GEP-2257. When this
// field is unspecified, request timeout behavior is implementation-specific.
//
// Support: Extended
//
Expand All @@ -342,8 +342,10 @@ type HTTPRouteTimeouts struct {
// may result in more than one call from the gateway to the destination backend,
// for example, if automatic retries are supported.
//
// Because the Request timeout encompasses the BackendRequest timeout, the value of
// BackendRequest must be <= the value of Request timeout.
// The value of BackendRequest must be a Gateway API Duration string as defined by
// GEP-2257. When this field is unspecified, its behavior is implementation-specific;
// when specified, the value of BackendRequest must be no more than the value of the
// Request timeout (since the Request timeout encompasses the BackendRequest timeout).
//
// Support: Extended
//
Expand Down
26 changes: 14 additions & 12 deletions config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

144 changes: 144 additions & 0 deletions config/crd/standard/gateway.networking.k8s.io_httproutes.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 11 additions & 9 deletions geps/gep-1742/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GEP-1742: HTTPRoute Timeouts

* Issue: [#1742](https://github.com/kubernetes-sigs/gateway-api/issues/1742)
* Status: Experimental
* Status: Standard

(See status definitions [here](overview.md#status).)

Expand Down Expand Up @@ -383,7 +383,7 @@ type HTTPRouteRule struct {
// Support: Extended
//
// +optional
// <gateway:experimental>
// <gateway:standard>
Timeouts *HTTPRouteTimeouts `json:"timeouts,omitempty"`

// ...
Expand All @@ -408,7 +408,8 @@ type HTTPRouteTimeouts struct {
// request stream has been received instead of immediately after the transaction is
// initiated by the client.
//
// When this field is unspecified, request timeout behavior is implementation-specific.
// The value of Request is a Gateway API Duration string as defined by GEP-2257. When this
// field is unspecified, request timeout behavior is implementation-specific.
//
// Support: Extended
//
Expand All @@ -423,16 +424,18 @@ type HTTPRouteTimeouts struct {
// may result in more than one call from the gateway to the destination backend,
// for example, if automatic retries are supported.
//
// Because the Request timeout encompasses the BackendRequest timeout, the value of
// BackendRequest must be <= the value of Request timeout.
// The value of BackendRequest must be a Gateway API Duration string as defined by
// GEP-2257. When this field is unspecified, its behavior is implementation-specific;
// when specified, the value of BackendRequest must be no more than the value of the
// Request timeout (since the Request timeout encompasses the BackendRequest timeout).
//
// Support: Extended
//
// +optional
BackendRequest *Duration `json:"backendRequest,omitempty"`
}

// Duration is a string value representing a duration in time. The foramat is as specified
// Duration is a string value representing a duration in time. The format is as specified
// in GEP-2257, a strict subset of the syntax parsed by Golang time.ParseDuration.
//
// +kubebuilder:validation:Pattern=`^([0-9]{1,5}(h|m|s|ms)){1,4}$`
Expand Down Expand Up @@ -474,7 +477,7 @@ Timeouts could be configured using policy attachments or in objects other than `
Instead of configuring timeouts directly on an API object, they could be configured using policy
attachments. The advantage to this approach would be that timeout policies can be not only
configured for an `HTTPRouteRule`, but can also be added/overriden at a more fine
(e.g., `HTTPBackendRef`) or course (e.g. `HTTPRoute`) level of granularity.
(e.g., `HTTPBackendRef`) or coarse (e.g. `HTTPRoute`) level of granularity.

The downside, however, is complexity introduced for the most common use case, adding a simple
timeout for an HTTP request. Setting a single field in the route rule, instead of needing to
Expand Down Expand Up @@ -503,5 +506,4 @@ previous section, is likely a better way to handle timeout configuration above t

## References

(Add any additional document links. Again, we should try to avoid
too much content not in version control to avoid broken links)
[GEP-2257]:/geps/gep-2257/
12 changes: 9 additions & 3 deletions geps/gep-1742/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: internal.gateway.networking.k8s.io/v1alpha1
kind: GEPDetails
number: 1742
name: HTTPRoute Timeouts
status: Experimental
status: Standard
authors:
- youngnick
- spacewander
Expand All @@ -12,7 +12,13 @@ authors:
- robscott
- sjberman
relationships:
extendedBy:
seeAlso:
- number: 2257
name: Gateway API Duration Format
description: Adds a duration format for us in timeouts.
description: Defines the duration format used by HTTPRoute timeouts.
references:
- https://datatracker.ietf.org/doc/html/rfc8174
- https://datatracker.ietf.org/doc/html/rfc2119
changelog:
- https://github.com/kubernetes-sigs/gateway-api/pull/3210

Loading

0 comments on commit a311340

Please sign in to comment.