Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Hassen-RHIMI opened this issue Nov 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Hassen-RHIMI
Copy link

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

  • 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:

    • type: kafka
      metadata:
      bootstrapServers: "xxxxxx"
      consumerGroup: "int-sync-animations-commerciales"
      lagThreshold: "100"
      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

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

@Hassen-RHIMI Hassen-RHIMI added the bug Something isn't working label Nov 28, 2024
@MaxWinterstein
Copy link

There is already some discussion about that value here: #5730

I am also seeing this with the redis scaler btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: To Triage
Development

No branches or pull requests

2 participants