Skip to content

ScaleToZero doesn't reset Fallback status leading to issues if the previous state was a failure #7488

Description

@Sayrus

Report

Context:

  • We use ArgoCD. Argo ensures ScaledObject are healthy for a sync to progress.
  • We introduced Scale to Zero with a fallback behavior if metrics are down
  • Fallback contains a number of replica higher than our usual baseline. This ensures availability during scaling errors.

Due to the third point, queues are usually empty when scaling is working again. This leads to Keda switching from Fallback to Idle.

Since scaleToZero doesn't reset statuses, the inactive ScaledObject contains the following:

    - message: At least one trigger is falling back on this scaled object                                                                                                                                        
      reason: FallbackExists                                                                                                                                                                                     
      status: "True"                                                                                                                                                                                             
      type: Fallback   

For ArgoCD, this means this ScaledObject is actively failing.

Expected Behavior

Scale to zero should reset statuses as the ScaledObject is healthy and at idle scaling levels.

Actual Behavior

Statuses are kept as-is from before the scale to zero. Error statuses are kept meaning a healthy ScaledObject is reporting an error.

Steps to Reproduce the Problem

  1. Make a ScaledObject go from a scaling error to scale to zero behavior. This can be simulated using kubectl patch scaledobject my-scaled-object --subresource=status --type=json -p='[{"op": "replace", "path": "/status/conditions/2/message", "value": "At least one trigger is falling back on this scaled object"}, {"op": "replace", "path": "/status/conditions/2/reason", "value": "FallbackExists"},{"op": "replace", "path": "/status/conditions/2/status", "value": "True"}]'
  2. Observe Keda not resetting that error status

Logs from KEDA operator

No errors, no relevant logs to this issue;

KEDA Version

2.18.3

Kubernetes Version

1.33

Platform

Amazon Web Services

Scaler Details

Prometheus

Would you be open to contributing a fix?

Yes

Anything else?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Ready To Ship

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions