Skip to content

fix: default HPA metrics for fixed replica bounds - #854

Closed
labuladong wants to merge 1 commit into
masterfrom
codex/fixed-replica-hpa
Closed

labuladong wants to merge 1 commit into
masterfrom
codex/fixed-replica-hpa

Conversation

@labuladong

Copy link
Copy Markdown
Member

A Function with minReplicas=maxReplicas=1 and no explicit autoscaling policy gets an HPA with no metrics. Kubernetes defaults it to 80% CPU utilization, while the operator continues comparing it with an empty desired metrics list. The workload and HPA can be healthy, but the Function remains HPAReady=False with Action=Update.

Use the existing default metrics selection when the replica bounds are equal as well. Replica bounds remain fixed. This one-condition change applies through the shared HPA generator used by Functions, Sources, and Sinks.

Validation:

  • Observed the mismatch on a fresh AWS v2 test CE: the Function successfully transformed a Pulsar message, its Pod was 2/2 Ready, and the HPA reported ScalingActive=True, but the Function retained HPAReady=False/Update.
  • Added a regression test that models API-server defaulting; it fails before the fix and passes after it.
  • go test ./controllers/spec -count=1
  • Reviewed the diff for scope and simplification; git diff --check passes.

No controller deployment or shared control-plane change was made. Runtime validation of a rebuilt operator remains pending.

Co-authored-by: Codex <codex@openai.com>
@github-actions

Copy link
Copy Markdown

@labuladong:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@github-actions github-actions Bot added the doc-info-missing This pr needs to mark a document option in description label Oct 16, 2026
@labuladong labuladong closed this Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-info-missing This pr needs to mark a document option in description

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant