Skip to content

KEDA deployer: default minReplicaCount prevents scale-to-zero #3924

Description

@matejvasek

The KEDA deployer defaults minReplicaCount to 1, which means functions never scale to zero — KEDA will only scale down to the configured minimum.

Location: pkg/keda/deployer.go

minScale := int32(1)

This value is set on the HTTPScaledObject's Replicas.Min. For scale-to-zero to happen, minReplicaCount must be 0.

Current behavior: Functions always keep at least 1 replica running, even with no traffic.

Expected behavior: Consider defaulting to 0 so functions can scale to zero when idle, which is one of KEDA's main features. Users who prefer to avoid cold-start latency can explicitly set scale.min: 1 in their function config.

Trade-off: Changing the default to 0 enables scale-to-zero but introduces cold-start latency for the first request after idle. The KEDA HTTP add-on interceptor handles this by holding the request until a pod is ready, so requests aren't dropped — but latency increases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions