-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Multiple Triggeres for a scaledobject not working as expected. #5078
Comments
Hello, |
I noticed the logs had issue with the kafka connector, so replaced the kafka trigger with memory trigger to test. spec:
I see cron wokring as expected, however the scaledobjects show only cron. Also, after cooling down it is not going back to 0 replicas instead scaling down to 1 from 4. My requirement is to scale down the pods to 0 during the weekend, however using cron jobs I was able to only scale up and not scale down. Could you please suggest an alternative. |
If you have CPU and/or Memory + other triggers, you can scale to 0 based on those other triggers and the CPU/memory won't block the scale to zero (since v2.11). In your case, I guess that you have multiple scalers (cron + kafka) and all of them can scale from/to 0, so if there is at least one that requires scaling from 0, you will have at least 1 instance and this is because as default, HPA controller does a MAX between all the metrics and KEDA respects that approach (even cron isn't active, kafka is, so KEDA scalers to 1 your workload). In this case, we recently (v2.12) added a new experimental formula for modifying the scalers applying custom formulas. This allows you for enabling scenarios like setting cron In your case, your ScaledObject could look like: apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: keda-kafka-queue2
namespace: 60486a51-7069-4d45-d1be-a0069c86f864
spec:
....
advanced:
scalingModifiers:
formula: "kafka_scaler * cron_scaler"
target: "1"
triggers:
- type: kafka
metadata:
...
# lagThreshold: '1' THIS VALUE ISN'T REQUIRED AS IT'S OVERRIDED
authenticationRef:
name: keda-trigger-auth-kafka-credential
name: kafka_scaler
- type: cron #Testing for 30 mins
metadata:
...
desiredReplicas: "1" # THIS IS REQUIRED AS IT'S RETURNED VALUE
name: cron_scaler |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed due to inactivity. |
Report
I am trying to implement schedule-based scaling using keda where trying make the pods to 0 during weekends and faced a 2-part issue.
Below is the scaledobject used.
Also, the scaled object when applied only shows the first trigger (Not showing and functionality is also not working). used
kubectl get scaledobject -A.
Could someone please look into this and suggest if the multiple trigger feature is working in keda if so am I using it incorrectly. Please suggest.
Expected Behavior
Actual Behavior
Steps to Reproduce the Problem
Logs from KEDA operator
KEDA Version
None
Kubernetes Version
None
Platform
None
Scaler Details
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: