kedacore / keda

KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
https://keda.sh
Apache License 2.0
8.58k stars 1.09k forks source link

The scaled workload does not function properly when the minimum replica count is set to 0 #6374

Open Hassen-RHIMI opened 2 days ago

Hassen-RHIMI commented 2 days ago

Report

I’m using the Kafka scaler (Confluent) to monitor Kafka lags and manage the scaling of my workloads based on the defined lag threshold. My configuration includes setting minReplicaCount to 0 to allow workloads to scale down to zero when there is no lag.

However, the expected behavior doesn’t occur—KEDA consistently keeps at least one replica running even when there are no new messages and the lag is zero.

Additionally, when minReplicaCount is set to 0, the HPA metric displays an unusual value of -9223372036854775808m (likely an int64 conversion issue). This happens despite the external metric value in GCP being correct.

Expected Behavior

  1. KEDA should downscale the workload to zero replicas when there is no lag.

  2. The HPA should display the correct metric value when minReplicaCount is set to 0.

Actual Behavior

Steps to Reproduce the Problem

Capture d’écran 2024-11-28 à 12 47 57

Logs from KEDA operator

example

KEDA Version

2.16.0

Kubernetes Version

1.30

Platform

Google Cloud

Scaler Details

Apache kafka

Anything else?

No response

MaxWinterstein commented 2 days ago

There is already some discussion about that value here: https://github.com/kedacore/keda/issues/5730

I am also seeing this with the redis scaler btw.