Skip to content

KPA initial scale can exceed max-scale and prevent activation #16709

Description

@jahnavigajjala-3

Description

The KPA scaler does not consistently enforce max-scale when applying a revision's initial scale.

When initialScale exceeds a configured positive maxScale, the initial-scale adjustment can raise minScale above maxScale. This violates the bounds expected by the scaler and can cause the revision to scale beyond its configured maximum.

There is also a related activation-threshold inconsistency. The KPA's activeThreshold() uses the initial scale without capping it at maxScale. If the scaler is limited to fewer replicas than the activation threshold requires, the PodAutoscaler may remain in the Activating state until timing out.

Steps to reproduce

Configure a revision with:

  • initial-scale: "5"
  • max-scale: "2"

Observe the desired replica count and PodAutoscaler activation behavior.

Expected behavior

  • The initial desired scale should not exceed a configured positive maxScale.
  • The activation threshold should be consistent with the effective scale bounds.
  • maxScale = 0 should continue to mean unlimited.
  • Existing behavior for unreachable revisions and already-initialized scale targets should remain unchanged.

Actual behavior

The initial-scale adjustment can exceed the configured maximum. The activation threshold can also require more ready replicas than the maximum allows, potentially leaving the PodAutoscaler stuck in Activating.

Proposed fix

Clamp the initial scale to the configured positive maximum and ensure the KPA activation threshold uses a consistent effective bound. Add regression tests covering maximum-scale enforcement, unlimited maximum scale, and activation readiness.

I have reproduced the behavior and am validating a fix with regression tests.

Activity

  1. amarkdotdev commented on Nov 3, 2026

    @amarkdotdev

    Opened #16742. /assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions