Skip to content

Commit 02dcf28

Browse files
authored
[Feature] [Platform] Adjust Gateway Timeouts (#1868)
1 parent 335922d commit 02dcf28

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- (Feature) Add Default Container Mods
99
- (Documentation) Improve Charts and Upgrade Documentation
1010
- (Feature) AutoDiscover Operator Access
11+
- (Feature) (Platform) Adjust Gateway timeouts
1112

1213
## [1.2.47](https://github.com/arangodb/kube-arangodb/tree/1.2.47) (2025-03-28)
1314
- (Bugfix) Use Profile Annotations

docs/api/ArangoRoute.V1Alpha1.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ UID keeps the information about object UID
8383

8484
### .spec.destination.path
8585

86-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.47/pkg/apis/networking/v1alpha1/route_spec_destination.go#L51)</sup>
86+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.47/pkg/apis/networking/v1alpha1/route_spec_destination.go#L52)</sup>
8787

8888
Path defines service path used for overrides
8989

9090
***
9191

9292
### .spec.destination.protocol
9393

94-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.47/pkg/apis/networking/v1alpha1/route_spec_destination.go#L45)</sup>
94+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.47/pkg/apis/networking/v1alpha1/route_spec_destination.go#L46)</sup>
9595

9696
Protocol defines http protocol used for the route
9797

@@ -103,7 +103,7 @@ Possible Values:
103103

104104
### .spec.destination.schema
105105

106-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.47/pkg/apis/networking/v1alpha1/route_spec_destination.go#L40)</sup>
106+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.47/pkg/apis/networking/v1alpha1/route_spec_destination.go#L41)</sup>
107107

108108
Schema defines HTTP/S schema used for connection
109109

@@ -155,7 +155,7 @@ UID keeps the information about object UID
155155

156156
### .spec.destination.timeout
157157

158-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.47/pkg/apis/networking/v1alpha1/route_spec_destination.go#L59)</sup>
158+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.47/pkg/apis/networking/v1alpha1/route_spec_destination.go#L60)</sup>
159159

160160
Timeout specify the upstream request timeout
161161

pkg/apis/networking/v1alpha1/route_spec_destination.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525

2626
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
2727
"github.com/arangodb/kube-arangodb/pkg/util/constants"
28+
"github.com/arangodb/kube-arangodb/pkg/util/errors"
2829
)
2930

3031
type ArangoRouteSpecDestination struct {
@@ -139,6 +140,14 @@ func (a *ArangoRouteSpecDestination) Validate() error {
139140
shared.ValidateOptionalInterfacePath("tls", a.TLS),
140141
shared.ValidateOptionalInterfacePath("authentication", a.Authentication),
141142
shared.PrefixResourceError("path", shared.ValidateAPIPath(a.GetPath())),
143+
shared.PrefixResourceErrorFunc("timeout", func() error {
144+
if t := a.GetTimeout(); t.Duration < constants.MinEnvoyUpstreamTimeout {
145+
return errors.Errorf("Timeout lower than %s not allowed", constants.MinEnvoyUpstreamTimeout.String())
146+
} else if t.Duration > constants.MaxEnvoyUpstreamTimeout {
147+
return errors.Errorf("Timeout greater than %s not allowed", constants.MaxEnvoyUpstreamTimeout.String())
148+
}
149+
return nil
150+
}),
142151
); err != nil {
143152
return err
144153
}

pkg/util/constants/gateway.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020

2121
package constants
2222

23-
import "time"
23+
import (
24+
"time"
25+
)
2426

2527
const (
2628
DefaultEnvoyUpstreamTimeout = time.Minute
27-
MaxEnvoyUpstreamTimeout = 15 * time.Minute
28-
MinEnvoyUpstreamTimeout = 15 * time.Second
29+
MaxEnvoyUpstreamTimeout = time.Hour
30+
MinEnvoyUpstreamTimeout = time.Duration(0)
2931

3032
ConfigMapChecksumKey = "CHECKSUM"
3133

0 commit comments

Comments
 (0)