Skip to content

Commit c045968

Browse files
Merge pull request #1951 from openshift-cherrypick-robot/cherry-pick-1937-to-release-4.14
[release-4.14] OCPBUGS-36555: Ingress - add connect timeout to tuning options
2 parents 3e8192a + 2f76710 commit c045968

7 files changed

Lines changed: 119 additions & 0 deletions

openapi/generated_openapi/zz_generated.openapi.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/openapi.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25941,6 +25941,10 @@
2594125941
"description": "clientTimeout defines how long a connection will be held open while waiting for a client response.\n\nIf unset, the default timeout is 30s",
2594225942
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Duration"
2594325943
},
25944+
"connectTimeout": {
25945+
"description": "ConnectTimeout defines the maximum time to wait for a connection attempt to a server/backend to succeed.\n\nThis 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\".\n\nWhen 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 5s.",
25946+
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Duration"
25947+
},
2594425948
"headerBufferBytes": {
2594525949
"description": "headerBufferBytes describes how much memory should be reserved (in bytes) for IngressController connection sessions. Note that this value must be at least 16384 if HTTP/2 is enabled for the IngressController (https://tools.ietf.org/html/rfc7540). If this field is empty, the IngressController will use a default value of 32768 bytes.\n\nSetting this field is generally not recommended as headerBufferBytes values that are too small may break the IngressController and headerBufferBytes values that are too large could cause the IngressController to use significantly more memory than necessary.",
2594625950
"type": "integer",

operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,10 @@ spec:
802802
description: "clientTimeout defines how long a connection will be held open while waiting for a client response. \n If unset, the default timeout is 30s"
803803
format: duration
804804
type: string
805+
connectTimeout:
806+
description: "ConnectTimeout defines the maximum time to wait for a connection attempt to a server/backend to succeed. \n 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\". \n 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 5s."
807+
pattern: ^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$
808+
type: string
805809
headerBufferBytes:
806810
description: "headerBufferBytes describes how much memory should be reserved (in bytes) for IngressController connection sessions. Note that this value must be at least 16384 if HTTP/2 is enabled for the IngressController (https://tools.ietf.org/html/rfc7540). If this field is empty, the IngressController will use a default value of 32768 bytes. \n Setting this field is generally not recommended as headerBufferBytes values that are too small may break the IngressController and headerBufferBytes values that are too large could cause the IngressController to use significantly more memory than necessary."
807811
format: int32

operator/v1/stable.ingresscontroller.testsuite.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,3 +476,85 @@ tests:
476476
set:
477477
value: DENY
478478
expectedError: 'IngressController.operator.openshift.io "default-not-allowed-values" is invalid: [spec.httpHeaders.actions.response[0].action.type: Required value, <nil>: Invalid value: "null": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation]'
479+
- name: Should be able to create an IngressController with valid nominal connect timeout
480+
initial: |
481+
apiVersion: operator.openshift.io/v1
482+
kind: IngressController
483+
metadata:
484+
name: default
485+
namespace: openshift-ingress-operator
486+
spec:
487+
tuningOptions:
488+
connectTimeout: 10s
489+
expected: |
490+
apiVersion: operator.openshift.io/v1
491+
kind: IngressController
492+
metadata:
493+
name: default
494+
namespace: openshift-ingress-operator
495+
spec:
496+
httpEmptyRequestsPolicy: Respond
497+
tuningOptions:
498+
connectTimeout: 10s
499+
- name: Should be able to create an IngressController with valid composite connect timeout
500+
initial: |
501+
apiVersion: operator.openshift.io/v1
502+
kind: IngressController
503+
metadata:
504+
name: default
505+
namespace: openshift-ingress-operator
506+
spec:
507+
tuningOptions:
508+
connectTimeout: 100ms300μs
509+
expected: |
510+
apiVersion: operator.openshift.io/v1
511+
kind: IngressController
512+
metadata:
513+
name: default
514+
namespace: openshift-ingress-operator
515+
spec:
516+
httpEmptyRequestsPolicy: Respond
517+
tuningOptions:
518+
connectTimeout: 100ms300μs
519+
- name: Should be able to create an IngressController with valid fraction connect timeout
520+
initial: |
521+
apiVersion: operator.openshift.io/v1
522+
kind: IngressController
523+
metadata:
524+
name: default
525+
namespace: openshift-ingress-operator
526+
spec:
527+
tuningOptions:
528+
connectTimeout: 1.5m
529+
expected: |
530+
apiVersion: operator.openshift.io/v1
531+
kind: IngressController
532+
metadata:
533+
name: default
534+
namespace: openshift-ingress-operator
535+
spec:
536+
httpEmptyRequestsPolicy: Respond
537+
tuningOptions:
538+
connectTimeout: 1.5m
539+
- name: Should not be able to create an IngressController with invalid unit connect timeout
540+
initial: |
541+
apiVersion: operator.openshift.io/v1
542+
kind: IngressController
543+
metadata:
544+
name: default
545+
namespace: openshift-ingress-operator
546+
spec:
547+
tuningOptions:
548+
connectTimeout: 3d
549+
expectedError: "IngressController.operator.openshift.io \"default\" is invalid: spec.tuningOptions.connectTimeout: Invalid value: \"3d\": spec.tuningOptions.connectTimeout in body should match '^(0|([0-9]+(\\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$'"
550+
- name: Should not be able to create an IngressController with invalid space connect timeout
551+
initial: |
552+
apiVersion: operator.openshift.io/v1
553+
kind: IngressController
554+
metadata:
555+
name: default
556+
namespace: openshift-ingress-operator
557+
spec:
558+
tuningOptions:
559+
connectTimeout: "4 s"
560+
expectedError: "IngressController.operator.openshift.io \"default\" is invalid: spec.tuningOptions.connectTimeout: Invalid value: \"4 s\": spec.tuningOptions.connectTimeout in body should match '^(0|([0-9]+(\\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$'"

operator/v1/types_ingress.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,23 @@ type IngressControllerTuningOptions struct {
16451645
// +optional
16461646
TunnelTimeout *metav1.Duration `json:"tunnelTimeout,omitempty"`
16471647

1648+
// ConnectTimeout defines the maximum time to wait for
1649+
// a connection attempt to a server/backend to succeed.
1650+
//
1651+
// This field expects an unsigned duration string of decimal numbers, each with optional
1652+
// fraction and a unit suffix, e.g. "300ms", "1.5h" or "2h45m".
1653+
// Valid time units are "ns", "us" (or "µs" U+00B5 or "μs" U+03BC), "ms", "s", "m", "h".
1654+
//
1655+
// When omitted, this means the user has no opinion and the platform is left
1656+
// to choose a reasonable default. This default is subject to change over time.
1657+
// The current default is 5s.
1658+
//
1659+
// +kubebuilder:validation:Optional
1660+
// +kubebuilder:validation:Pattern=^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$
1661+
// +kubebuilder:validation:Type:=string
1662+
// +optional
1663+
ConnectTimeout *metav1.Duration `json:"connectTimeout,omitempty"`
1664+
16481665
// tlsInspectDelay defines how long the router can hold data to find a
16491666
// matching route.
16501667
//

operator/v1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

operator/v1/zz_generated.swagger_doc_generated.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)