-
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
KEDA doesn't validate empty array of triggers #5520
Comments
hmmm....that's interesting. From where this 80% of averageUtilization for CPU is coming in the HPA? |
It's K8s default behavior. When I create an HPA directly without metrics spec, k8s will create an HPA with 80% of averageUtilization for CPU resource. HPA example: apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: test
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: sut
minReplicas: 1
maxReplicas: 10 |
So that means HPA should not be defaulted to as a scaling option when triggers are empty in the KEDA's ScaledObject |
I think that we should validate it as part of admission hooks and also raise an error in the operator. Adding default value is quite weird as it's totally unrelated with the given triggers. This doesn't happen just with empty |
I agree, we should validate both on the Operator and validation webhook side. This is an ideal "good first issue " :) |
Yes, this is k8s default behavior, as described in both k8s and KEDA documentation, and we have been relying on it. I think this new behavior is a breaking change and a regression. Can this be reverted? Or at least, can an option to configure it be added? |
Report
When
triggers
is set with an empty array in ScaledObject, KEDA doesn't validate this empty value and will create a default HPA with a default 80% averageUtilization CPU resource. This can mislead users.Here is the yaml example:
BTW, KEDA will block creation if the value of
triggers
is empty.Expected Behavior
Block this creation of ScaledObject if
triggers
is set with an empty array.Actual Behavior
ScaledObject is created normally and a default HPA will also be created.
Steps to Reproduce the Problem
KEDA Version
2.13.0
Kubernetes Version
1.27
Platform
Other
Scaler Details
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: