×

You can configure timeout durations for revisions globally or individually to control the time spent on requests.

Configuring revision timeout

You can configure the default number of seconds for the revision timeout based on the request.

Prerequisites
  • You have installed the OpenShift Serverless Operator and Knative Serving.

  • You have cluster administrator permissions on OpenShift Container Platform, or cluster or dedicated administrator permissions on Red Hat OpenShift Service on AWS or OpenShift Dedicated.

Procedure
  • Choose the appropriate method to configure the revision timeout:

    • To configure the revision timeout globally, set the revision-timeout-seconds field in the KnativeServing custom resource (CR):

      apiVersion: operator.knative.dev/v1beta1
      kind: KnativeServing
      metadata:
        name: knative-serving
        namespace: knative-serving
      spec:
        config:
          defaults:
            revision-timeout-seconds: "300"
    • To configure the timeout per revision by setting the timeoutSeconds field in your service definition:

      apiVersion: serving.knative.dev/v1
      kind: Service
      metadata:
        namespace: my-ns
      spec:
        template:
          spec:
            timeoutSeconds: 300
            containers:
            - image: ghcr.io/knative/helloworld-go:latest

Configuring maximum revision timeout

By seting the maximum revision timeout, you can ensure that no revision can exceed a specific limit.

Prerequisites
  • You have installed the OpenShift Serverless Operator and Knative Serving.

  • You have cluster administrator permissions on OpenShift Container Platform, or cluster or dedicated administrator permissions on Red Hat OpenShift Service on AWS or OpenShift Dedicated.

Procedure
  • To configure the maximum revision timeout, set the max-revision-timeout-seconds field in the KnativeServing custom resource (CR):

    If this value is increased, the activator `terminationGracePeriodSeconds` should also be increased to prevent in-flight requests being disrupted.
    apiVersion: operator.knative.dev/v1beta1
    kind: KnativeServing
    metadata:
      name: knative-serving
      namespace: knative-serving
    spec:
      config:
        defaults:
          max-revision-timeout-seconds: "600"