Skip to content

Allow KEDA minReplicas to be zero - #1970

Open
KundanDhage wants to merge 1 commit into
fluxcd:mainfrom
KundanDhage:kundandhage-allow-keda-zero-replicas
Open

KundanDhage wants to merge 1 commit into
fluxcd:mainfrom
KundanDhage:kundandhage-allow-keda-zero-replicas

Conversation

@KundanDhage

@KundanDhage KundanDhage commented Sep 7, 2026 •

Copy link
Copy Markdown

Summary

Flagger's Canary CRD rejects autoscalerRef.primaryScalerReplicas.minReplicas: 0, even when the referenced autoscaler is a KEDA ScaledObject, which supports scale-to-zero (minReplicaCount: 0). This blocks event-driven / scale-to-zero setups.

Change

Updated the CEL validation rule so minReplicas >= 1 is still enforced for HorizontalPodAutoscaler, but minReplicas: 0 is now allowed for ScaledObject. Regenerated CRD manifests via make manifests — no hand-edited YAML.

Testing
go test ./pkg/apis/flagger/v1beta1/...

Covers: minReplicas: 0 + ScaledObject (accepted), minReplicas: 0 + HorizontalPodAutoscaler (still rejected), minReplicas: 1 + either kind (regression check).

Open question

Are there other places assuming minReplicas is never zero (reconciler, scaling logic)? Happy to extend if so.

Closes #1869

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Kundan Dhage <kundan@acsgaming.com>
@KundanDhage
KundanDhage force-pushed the kundandhage-allow-keda-zero-replicas branch from 96723e7 to ec39ff4 Compare September 9, 2026 15:12

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

minReplicas cannot be set to 0 when using KEDA ScaledObject

2 participants