You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trigger metrics comes from replica itself, 0->1 scale currently would not work since there is a circular dependency. No metrics data can be retrieved since there is 0 replica to serve the endpoint, thus KEDA does not trigger 0->1.
Expected Behavior
0->1 scale up works when there are traffic and idleReplicaCount set to 0.
Actual Behavior
1->0 works when there are no traffic and idleReplicaCount set to 0. The metrics comes from the replica. When there are traffic coming, 0->1 doesn't work, the replica stays at 0.
Hello
The problem here is that you are trying to scale an HTTP workload, and it works quite different. It doesn't matter if you use your application metric or the ingress metric, it won't work to scale from zero because nobody is holding the request.
About the original title, this isn't a bug for KEDA but an architecture issue totally unrelated with KEDA. If the metric is there, KEDA will work, but ensuring that the metric is available isn't the responsibility of KEDA. It's the same as you could have with other sources like CPU or memory, 0 instances will never trigger any scaling because 0 instances implicitly means 0 consumption, nothing related with the metrics server.
About the actual issue that you have, if you want to scale from 0 an HTTP workload, you need something in the middle that holds the request until the backend is up un running, otherwise your ingress will return an error because there isn't any available backend to response the request. The only option that we can suggest atm to allow scaling from/to zero an HTTP workload is the HTTP Add-on -> https://github.com/kedacore/http-add-on
The add-on is a component that holds the request until the backend is up and running, exposing metrics to KEDA to trigger the scaling.
I close the issue as it's not a bug but a design fact, but feel free to comment whatever you think that it's useful
Report
When trigger metrics comes from replica itself, 0->1 scale currently would not work since there is a circular dependency. No metrics data can be retrieved since there is 0 replica to serve the endpoint, thus KEDA does not trigger 0->1.
Expected Behavior
0->1 scale up works when there are traffic and idleReplicaCount set to 0.
Actual Behavior
1->0 works when there are no traffic and idleReplicaCount set to 0. The metrics comes from the replica. When there are traffic coming, 0->1 doesn't work, the replica stays at 0.
Steps to Reproduce the Problem
spec:
maxRepicaCount: 8
minReplicaCount: 1
idleReplicaCount: 0
...
triggers:
query: sum(rate(mux_router_request_total{service="myapp"}[2m]))
serverAddress: http://opensrc-prometheus.prometheus-system.svc.cluster.local:9090
type: Prometheus
Logs from KEDA operator
KEDA Version
2.14.1
Kubernetes Version
1.28
Platform
Microsoft Azure
Scaler Details
Prometheus
Anything else?
No response
The text was updated successfully, but these errors were encountered: