HTTPScaledObject (Deprecated) Latest

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

Suggest a change

Deprecated: HTTPScaledObject (v1alpha1) is deprecated. InterceptorRoute (v1beta1) is the current API. See Migrate from HTTPScaledObject to InterceptorRoute to upgrade.

API versionhttp.keda.sh/v1alpha1
KindHTTPScaledObject
Short namehttpso
ScopeNamespaced

Example

apiVersion: http.keda.sh/v1alpha1
kind: HTTPScaledObject
metadata:
  name: my-app
  namespace: default
spec:
  hosts:
    - app.example.com
  pathPrefixes:
    - /api
  scaleTargetRef:
    name: my-app
    service: my-app-svc
    port: 8080
  replicas:
    min: 0
    max: 10
  scalingMetric:
    concurrency:
      targetValue: 100

Annotations

AnnotationValueDescription
httpscaledobject.keda.sh/skip-scaledobject-creation"true"Skip automatic ScaledObject creation. Set this when you want to integrate the HTTP scaler with other KEDA scalers in a single ScaledObject that you manage yourself.
httpscaledobject.keda.sh/orphan-scaledobject"true"When the HTTPScaledObject is deleted, leave the generated ScaledObject in place instead of deleting it.

When skip-scaledobject-creation is set to "true", the operator does not create or manage a ScaledObject. You can then create your own ScaledObject and add the HTTP external scaler as one of the triggers:

triggers:
  - type: external-push
    metadata:
      httpScaledObject: <your-httpso-name>
      scalerAddress: keda-add-ons-http-external-scaler.keda:9090

Note: The InterceptorRoute API does not use this annotation. InterceptorRoute separates routing from scaling by design — you always create your own ScaledObject.

spec

FieldTypeRequiredDefaultDescription
hosts[]stringNoHostnames to route. Requests whose Host header matches any entry (combined with pathPrefixes) are routed to the target.
pathPrefixes[]stringNoURL path prefixes to match. Combined with hosts for routing.
headers[]HeaderNoCustom headers for routing. After hosts and pathPrefixes match, requests must also match all listed headers. The interceptor uses the most specific header match.
scaleTargetRefScaleTargetRefYesThe target workload and service to scale and route to.
coldStartTimeoutFailoverRef*ColdStartTimeoutFailoverRefNoFailover service to route to when the target is not available during cold start.
replicas*ReplicaStructNoMinimum and maximum replica counts.
targetPendingRequests*int32No100Deprecated. Use scalingMetric instead. Target metric value for the HPA.
scaledownPeriod*int32No300Cooldown period in seconds before resources scale down.
initialCooldownPeriod*int32No0Initial period in seconds before scaling begins.
scalingMetric*ScalingMetricSpecNoConfiguration for the scaling metric. When empty, concurrency-based scaling is used.
timeouts*HTTPScaledObjectTimeoutsSpecNoPer-object timeout overrides for the global interceptor timeouts.

ScaleTargetRef

FieldTypeRequiredDefaultDescription
namestringNoName of the Deployment or StatefulSet to scale.
apiVersionstringNoAPI version of the target workload.
kindstringNoKind of the target workload.
servicestringYesName of the Kubernetes Service to route to.
portint32NoPort number on the Service. Mutually exclusive with portName.
portNamestringNoNamed port on the Service. Mutually exclusive with port.

Validation: Exactly one of port or portName must be set.

FieldTypeRequiredDefaultDescription
namestringYesName of the HTTP header. Minimum length: 1.
value*stringNoValue to match (exact match). If omitted, the header must be present but any value is accepted.

ReplicaStruct

FieldTypeRequiredDefaultDescription
min*int32No0Minimum replica count.
max*int32No100Maximum replica count.

ScalingMetricSpec

concurrency and requestRate are mutually exclusive. Setting both produces undefined behavior. This differs from InterceptorRoute, which allows both to be set simultaneously.

FieldTypeRequiredDefaultDescription
concurrency*ConcurrencyMetricSpecNoScale based on concurrent requests.
requestRate*RateMetricSpecNoScale based on average request rate over a time window.

ConcurrencyMetricSpec

FieldTypeRequiredDefaultDescription
targetValueintNo100Target concurrent request count per replica.

RateMetricSpec

FieldTypeRequiredDefaultDescription
targetValueintNo100Target request rate per replica.
windowDurationNo1mTime window for rate calculation.
granularityDurationNo1sTime granularity for rate calculation.

ColdStartTimeoutFailoverRef

FieldTypeRequiredDefaultDescription
servicestringYesName of the failover Service to route to.
portint32NoPort number on the failover Service.
portNamestringNoNamed port on the failover Service.
timeoutSecondsint32No30Seconds to wait before routing to the failover service.

Validation: Exactly one of port or portName must be set.

HTTPScaledObjectTimeoutsSpec

FieldTypeRequiredDefaultDescription
conditionWaitDurationNoGlobal KEDA_CONDITION_WAIT_TIMEOUTTime to wait for the backing workload to reach 1 or more replicas before connecting and sending the HTTP request.
responseHeaderDurationNoGlobal KEDA_RESPONSE_HEADER_TIMEOUTTime to wait for response headers after the HTTP request is sent to the backing application.

status

FieldTypeDescription
targetWorkloadstringResolved target workload reference.
targetServicestringResolved target service reference.
conditions[]metav1.ConditionConditions of the HTTPScaledObject. Keyed by type.

Condition types

TypeDescription
ReadyWhether the HTTPScaledObject is fully reconciled and routing traffic.