-
Notifications
You must be signed in to change notification settings - Fork 115
With multiple triggers (CPU and HTTP) and minReplicaCount of 0, KEDA erroneously scales to 0. #1262
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
Comments
I have the same problem with HTTP scaler + Cron. I'm not GO dev, but from
and for the push
I get the feeling the http scaler will push the deactivation to KEDA, no matter what else active scalers there are in the ScaledObject, and this makes KEDA deactivating the workload briefly? Is this something to be fixed in KEDA itself, or in the http-add-on? Given the example from Implementing StreamIsActive the external push scaler should not push active=false ever ? StreamIsActive is calling IsActive, and the stream(push) should not return false, IsActive is probably fine to return false when called during polling, just to be clear :-) |
I think is the same issue -> #1147 |
@JorTurFer , what do you think, is my analysis makes sense? :-) |
Hi, just wanted to +1 this issue, I'm having the same difficulties making a cron trigger work with a http scaler. Version 0.10.0.
A pod spawns and then is immediately shut down |
If anyone needs this I've found a very stupid way of making this setup work. You basically create another cron ScaledObject that kills the Http Add-on at the same time 🤦 I tested it and it seems to be doing the job: what needs to be killed outside the cron gets killed, and during the cron, my app is up and scales based on http traffic. - kind: HTTPScaledObject
apiVersion: http.keda.sh/v1alpha1
metadata:
name: my-app-http
spec:
hosts:
- bla.bla.foo
scaleTargetRef:
name: my-app
kind: Deployment
apiVersion: apps/v1
service: my-app
port: 3601
replicas:
min: 1 # changed from 0 to 1
max: 3
scaledownPeriod: 30
scalingMetric:
concurrency:
targetValue: 10
- kind: ScaledObject
apiVersion: keda.sh/v1alpha1
metadata:
name: my-app-cron
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: my-app
pollingInterval: 10
cooldownPeriod: 30
initialCooldownPeriod: 0
minReplicaCount: 0
maxReplicaCount: 3
triggers:
- type: cron
metadata:
timezone: Europe/Paris
start: 0 9 * * 1-5
end: 0 19 * * 1-5
desiredReplicas: "1"
# New ScaledObject that kills the external-scaler on the same cron interval
- kind: ScaledObject
apiVersion: keda.sh/v1alpha1
metadata:
name: keda-external-scaler-cron
namespace: keda
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: keda-add-ons-http-external-scaler
pollingInterval: 10
cooldownPeriod: 30
initialCooldownPeriod: 0
minReplicaCount: 0
maxReplicaCount: 3
triggers:
- type: cron
metadata:
timezone: Europe/Paris
start: 0 9 * * 1-5
end: 0 19 * * 1-5
desiredReplicas: "1" Again, this is very stupid and only works if you are using the Http add-on for a specific app (should probably deploy in namespace-mode and not cluster-wide now that I think of it ; to be a bit cleaner). + I'm not familiar with Go so I don't think I can pull off a PR to fix the real issue, this is just a hack to get it working :/ |
Report
With CPU and the http-external-scaler together as triggers in the same scaled object, the http scaler is superseding the CPU scaler.
With CPU under heavy load and with http request(s) it scales up successfully, but KEDA subsequently intervenes and scales to 0 ignoring CPU.
Expected Behavior
Under heavy CPU load even with no http requests KEDA should not scale down to 0.
Actual Behavior
The HTTP add on appears to be overriding the CPU scaler.
Steps to Reproduce the Problem
Logs from KEDA HTTP operator
No response
HTTP Add-on Version
0.10.0
Kubernetes Version
None
Platform
Any
Anything else?
No response
The text was updated successfully, but these errors were encountered: