InterceptorRoute

Field-by-field API reference for the InterceptorRoute custom resource

Warning

You are currently viewing v0.15 of the documentation and it is not the latest. For the most recent documentation, kindly click here.
API versionhttp.keda.sh/v1beta1
KindInterceptorRoute
ScopeNamespaced

Example

apiVersion: http.keda.sh/v1beta1
kind: InterceptorRoute
metadata:
  name: my-app
  namespace: default
spec:
  target:
    service: my-app-svc
    port: 8080
  rules:
    - hosts:
        - app.example.com
      paths:
        - value: /api
  scalingMetric:
    concurrency:
      targetValue: 100

spec

FieldTypeRequiredDefaultDescription
targetTargetRefYesBackend service to route traffic to.
rules[]RoutingRuleNoRouting rules that define how requests are matched to this target.
scalingMetricScalingMetricSpecYesMetric configuration for autoscaling.
coldStartColdStartSpecNoCold start behavior when scaling from zero.
timeoutsInterceptorRouteTimeoutsNoTimeout configuration for request handling.

For usage guidance, see Configure Routing Rules and Configure Scaling Metrics.

TargetRef

Identifies a Service to route traffic to. Exactly one of port or portName must be set.

FieldTypeRequiredDefaultDescription
servicestringYesName of the Kubernetes Service. Minimum length: 1.
portint32NoPort number on the Service (1–65535). Mutually exclusive with portName.
portNamestringNoNamed port on the Service. Minimum length: 1. Mutually exclusive with port.

Validation: Exactly one of port or portName must be set. Setting both or neither produces a validation error.

RoutingRule

Defines a set of matching criteria for routing requests. All specified fields within a single rule use AND semantics (host AND path AND headers must match). Multiple rules use OR semantics (any rule can match).

FieldTypeRequiredDefaultDescription
hosts[]stringNoHostnames to match. Wildcard patterns (e.g., *.example.com) are supported. A single * acts as a catch-all. Exact matches take priority over wildcards; more specific wildcards (e.g., *.bar.example.com) take priority over less specific ones.
paths[]PathMatchNoPath prefixes to match. When multiple paths match, the longest prefix wins.
headers[]HeaderMatchNoHeaders that must all match the request (AND semantics).

PathMatch

FieldTypeRequiredDefaultDescription
valuestringYesPath prefix to match against. The longest matching prefix wins. Minimum length: 1.

HeaderMatch

FieldTypeRequiredDefaultDescription
namestringYesName of the HTTP header. Minimum length: 1.
value*stringNoValue to match against (exact match). If omitted, matches any value for the given header name.

ScalingMetricSpec

Defines what metric drives autoscaling. At least one of concurrency or requestRate must be set. When both are set, both metrics are reported and KEDA scales based on whichever demands more replicas.

FieldTypeRequiredDefaultDescription
concurrency*ConcurrencyTargetSpecNoScale based on concurrent request count.
requestRate*RequestRateTargetSpecNoScale based on request rate.

Validation: At least one of concurrency or requestRate must be set.

ConcurrencyTargetSpec

FieldTypeRequiredDefaultDescription
targetValueint32YesTarget concurrent request count per replica. Minimum: 1.

RequestRateTargetSpec

FieldTypeRequiredDefaultDescription
targetValueint32YesTarget request rate per replica. Minimum: 1.
windowDurationNo1mSliding time window over which the request rate is calculated.
granularityDurationNo1sBucket size for rate calculation within the window.

ColdStartSpec

Configures behavior while the target is not ready (scaling from zero).

FieldTypeRequiredDefaultDescription
fallback*ColdStartFallbackNoFallback service to route to when the target is scaling from zero and the readiness timeout expires.
placeholder*ColdStartPlaceholderNoPlaceholder response to serve while the target has no ready endpoints.

Validation: At least one of fallback or placeholder must be set.

When both are configured, the placeholder response is returned immediately while the backend scales up. If the backend does not become ready within the readiness timeout, the fallback service is used.

ColdStartFallback

FieldTypeRequiredDefaultDescription
service*ServiceRefNoKubernetes Service to use as the fallback target.

ServiceRef

FieldTypeRequiredDefaultDescription
namestringYesName of the Kubernetes Service. Minimum length: 1.
portint32NoPort number on the Service (1–65535). Mutually exclusive with portName.
portNamestringNoNamed port on the Service. Minimum length: 1. Mutually exclusive with port.

Validation: Exactly one of port or portName must be set. Setting both or neither produces a validation error.

ColdStartPlaceholder

FieldTypeRequiredDefaultDescription
response*StaticResponseYesStatic response to return immediately when the backend has no ready endpoints.

StaticResponse

Defines a static HTTP response.

FieldTypeRequiredDefaultDescription
statusCodeint32No503HTTP status code (100–599).
body*stringNoInline response body. Maximum length: 32,768 characters. Mutually exclusive with bodyFromConfigMap.
bodyFromConfigMap*ConfigMapKeyRefNoResponse body from a ConfigMap in the same namespace. The ConfigMap must have the label http.keda.sh/response-body: "true". Mutually exclusive with body.
headersmap[string]stringNoHTTP response headers.

Validation: At most one of body or bodyFromConfigMap may be set. If neither is set, the response has an empty body.

ConfigMapKeyRef

References a key within a ConfigMap.

FieldTypeRequiredDefaultDescription
namestringYesName of the ConfigMap. Minimum length: 1.
keystringNoKey within the ConfigMap. When omitted, the key is derived from the request path (without leading /, defaulting to index.html for /). Content-Type is auto-detected from the file extension unless explicitly set in headers.

InterceptorRouteTimeouts

Configures per-route request handling timeouts. When a field is unset, the global interceptor timeout configuration (KEDA_HTTP_*_TIMEOUT environment variables) is used.

FieldTypeRequiredDefaultDescription
readiness*DurationNoGlobal KEDA_HTTP_READINESS_TIMEOUTTime to wait for the backend to become ready (e.g., scale from zero). Set to 0s to disable the dedicated readiness deadline so the full request budget is available for cold starts. When a fallback service is configured and this is 0s, a 30s default is applied.
request*DurationNoGlobal KEDA_HTTP_REQUEST_TIMEOUTTotal time allowed for the entire request lifecycle. Set to 0s to disable the request deadline.
responseHeader*DurationNoGlobal KEDA_HTTP_RESPONSE_HEADER_TIMEOUTMaximum time to wait for response headers from the backend after the request has been sent. Does not include cold-start wait time. Set to 0s to disable the response header deadline.

status

FieldTypeDescription
conditions[]metav1.ConditionConditions of the InterceptorRoute. Keyed by type.

Condition types

TypeDescription
ReadyWhether the InterceptorRoute is fully reconciled and routing traffic.