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
KEDA should downscale the workload to zero replicas when there is no lag.
The HPA should display the correct metric value when minReplicaCount is set to 0.
Actual Behavior
KEDA maintains at least one replica even when there is no lag and minReplicaCount is set to 0.
The HPA displays an incorrect metric value, such as -9223372036854775808m, when minReplicaCount is set to 0. This happens despite the external metric from GCP reporting the correct value.
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
KEDA should downscale the workload to zero replicas when there is no lag.
The HPA should display the correct metric value when minReplicaCount is set to 0.
Actual Behavior
KEDA maintains at least one replica even when there is no lag and minReplicaCount is set to 0.
The HPA displays an incorrect metric value, such as -9223372036854775808m, when minReplicaCount is set to 0. This happens despite the external metric from GCP reporting the correct value.
Steps to Reproduce the Problem
ScaledObject configuration: `apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: name: sync-animations-commerciales-scaledobject namespace: api spec: scaleTargetRef: name: sync-animations-commerciales pollingInterval: 10
minReplicaCount: 0
triggers:
excludePersistentLag: "true" scaleToZeroOnInvalidOffset: "true"
sasl: "plaintext" tls: "enable"
authenticationRef: name: "kafka-trigger-auth"`
HPA reports a negative value, and the replicas remain at one despite scaling conditions
Logs from KEDA operator
KEDA Version
2.16.0
Kubernetes Version
1.30
Platform
Google Cloud
Scaler Details
Apache kafka
Anything else?
No response