diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc index 89c648300b..74b65dadee 100644 --- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc +++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc @@ -7619,6 +7619,16 @@ Automatically deploy the integration as Knative service when all conditions hold * Integration is using the Knative profile * All routes are either starting from an HTTP based consumer or a passive consumer (e.g. `direct` is a passive consumer) +|`timeoutSeconds` + +int64 +| + + +The maximum duration in seconds that the request instance is allowed to respond to a request. +This field propagates to the integration pod's terminationGracePeriodSeconds + +Refer to the Knative documentation for more information. + |=== diff --git a/docs/modules/traits/pages/knative-service.adoc b/docs/modules/traits/pages/knative-service.adoc index 5d8ebbedf6..2a69ff7ee0 100755 --- a/docs/modules/traits/pages/knative-service.adoc +++ b/docs/modules/traits/pages/knative-service.adoc @@ -89,6 +89,13 @@ Refer to the Knative documentation for more information. * Integration is using the Knative profile * All routes are either starting from an HTTP based consumer or a passive consumer (e.g. `direct` is a passive consumer) +| knative-service.timeout-seconds +| int64 +| The maximum duration in seconds that the request instance is allowed to respond to a request. +This field propagates to the integration pod's terminationGracePeriodSeconds + +Refer to the Knative documentation for more information. + |=== // End of autogenerated code - DO NOT EDIT! (configuration) diff --git a/helm/camel-k/crds/crd-integration-platform.yaml b/helm/camel-k/crds/crd-integration-platform.yaml index 3107e80cbd..daec64fde0 100644 --- a/helm/camel-k/crds/crd-integration-platform.yaml +++ b/helm/camel-k/crds/crd-integration-platform.yaml @@ -1496,6 +1496,13 @@ spec: default and must be expressed as a Golang `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the request + instance is allowed to respond to a request. This field + propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option applies the @@ -3510,6 +3517,13 @@ spec: default and must be expressed as a Golang `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the request + instance is allowed to respond to a request. This field + propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option applies the diff --git a/helm/camel-k/crds/crd-integration-profile.yaml b/helm/camel-k/crds/crd-integration-profile.yaml index 2c24920a10..36de9b0bf3 100644 --- a/helm/camel-k/crds/crd-integration-profile.yaml +++ b/helm/camel-k/crds/crd-integration-profile.yaml @@ -1373,6 +1373,13 @@ spec: default and must be expressed as a Golang `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the request + instance is allowed to respond to a request. This field + propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option applies the @@ -3270,6 +3277,13 @@ spec: default and must be expressed as a Golang `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the request + instance is allowed to respond to a request. This field + propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option applies the diff --git a/helm/camel-k/crds/crd-integration.yaml b/helm/camel-k/crds/crd-integration.yaml index 26fe736411..e17afad4c1 100644 --- a/helm/camel-k/crds/crd-integration.yaml +++ b/helm/camel-k/crds/crd-integration.yaml @@ -7437,6 +7437,13 @@ spec: default and must be expressed as a Golang `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the request + instance is allowed to respond to a request. This field + propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option applies the diff --git a/helm/camel-k/crds/crd-kamelet-binding.yaml b/helm/camel-k/crds/crd-kamelet-binding.yaml index 202a701edc..be5e330167 100644 --- a/helm/camel-k/crds/crd-kamelet-binding.yaml +++ b/helm/camel-k/crds/crd-kamelet-binding.yaml @@ -7730,6 +7730,13 @@ spec: `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the + request instance is allowed to respond to a request. + This field propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option diff --git a/helm/camel-k/crds/crd-pipe.yaml b/helm/camel-k/crds/crd-pipe.yaml index c2648f8c8b..4705e3e957 100644 --- a/helm/camel-k/crds/crd-pipe.yaml +++ b/helm/camel-k/crds/crd-pipe.yaml @@ -7728,6 +7728,13 @@ spec: `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the + request instance is allowed to respond to a request. + This field propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option diff --git a/pkg/apis/camel/v1/trait/knative_service.go b/pkg/apis/camel/v1/trait/knative_service.go index aa03a33856..a43706daa3 100644 --- a/pkg/apis/camel/v1/trait/knative_service.go +++ b/pkg/apis/camel/v1/trait/knative_service.go @@ -68,4 +68,9 @@ type KnativeServiceTrait struct { // * Integration is using the Knative profile // * All routes are either starting from an HTTP based consumer or a passive consumer (e.g. `direct` is a passive consumer) Auto *bool `property:"auto" json:"auto,omitempty"` + // The maximum duration in seconds that the request instance is allowed to respond to a request. + // This field propagates to the integration pod's terminationGracePeriodSeconds + // + // Refer to the Knative documentation for more information. + TimeoutSeconds *int64 `property:"timeout-seconds" json:"timeoutSeconds,omitempty"` } diff --git a/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go b/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go index a8db3093a2..662b260b8a 100644 --- a/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go +++ b/pkg/apis/camel/v1/trait/zz_generated.deepcopy.go @@ -640,6 +640,11 @@ func (in *KnativeServiceTrait) DeepCopyInto(out *KnativeServiceTrait) { *out = new(bool) **out = **in } + if in.TimeoutSeconds != nil { + in, out := &in.TimeoutSeconds, &out.TimeoutSeconds + *out = new(int64) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KnativeServiceTrait. diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml index 3107e80cbd..daec64fde0 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml @@ -1496,6 +1496,13 @@ spec: default and must be expressed as a Golang `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the request + instance is allowed to respond to a request. This field + propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option applies the @@ -3510,6 +3517,13 @@ spec: default and must be expressed as a Golang `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the request + instance is allowed to respond to a request. This field + propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option applies the diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml index 2c24920a10..36de9b0bf3 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml @@ -1373,6 +1373,13 @@ spec: default and must be expressed as a Golang `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the request + instance is allowed to respond to a request. This field + propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option applies the @@ -3270,6 +3277,13 @@ spec: default and must be expressed as a Golang `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the request + instance is allowed to respond to a request. This field + propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option applies the diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml index 26fe736411..e17afad4c1 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml @@ -7437,6 +7437,13 @@ spec: default and must be expressed as a Golang `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the request + instance is allowed to respond to a request. This field + propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option applies the diff --git a/pkg/resources/config/crd/bases/camel.apache.org_kameletbindings.yaml b/pkg/resources/config/crd/bases/camel.apache.org_kameletbindings.yaml index 202a701edc..be5e330167 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_kameletbindings.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_kameletbindings.yaml @@ -7730,6 +7730,13 @@ spec: `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the + request instance is allowed to respond to a request. + This field propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option diff --git a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml index c2648f8c8b..4705e3e957 100644 --- a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml +++ b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml @@ -7728,6 +7728,13 @@ spec: `time.Duration` string representation, rounded to a second precision. type: string + timeoutSeconds: + description: "The maximum duration in seconds that the + request instance is allowed to respond to a request. + This field propagates to the integration pod's terminationGracePeriodSeconds + \n Refer to the Knative documentation for more information." + format: int64 + type: integer visibility: description: "Setting `cluster-local`, Knative service becomes a private service. Specifically, this option diff --git a/pkg/trait/knative_service.go b/pkg/trait/knative_service.go index 65c93b8b29..50c87a4514 100644 --- a/pkg/trait/knative_service.go +++ b/pkg/trait/knative_service.go @@ -286,6 +286,9 @@ func (t *knativeServiceTrait) getServiceFor(e *Environment) (*serving.Service, e }, } + if t.TimeoutSeconds != nil { + svc.Spec.ConfigurationSpec.Template.Spec.TimeoutSeconds = t.TimeoutSeconds + } replicas := e.Integration.Spec.Replicas isUpdateRequired := false