-
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
Using 'Value' in CPU scaler results in an error (must set either a target raw value or a target utilization) #2200
Comments
hi @yogevyuval |
Hi, if src.Target.AverageUtilization == nil && src.Target.AverageValue == nil {
allErrs = append(allErrs, field.Required(fldPath.Child("target").Child("averageUtilization"), "must set either a target raw value or a target utilization"))
}
if src.Target.AverageUtilization != nil && src.Target.AverageValue != nil {
allErrs = append(allErrs, field.Forbidden(fldPath.Child("target").Child("averageValue"), "may not set both a target raw value and a target utilization"))
} Honestly, I didn't know about this changed behavior, but it seems that probably we should drop apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: hpa-cpu
namespace: keda
spec:
scaleTargetRef:
kind: Deployment
name: keda-metrics-apiserver
apiVersion: apps/v1
minReplicas: 1
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Value
value: 50 |
@JorTurFer So you are saying that the right thing is to use 'AverageValue'? |
|
Based on this ^, |
Thanks a ton for diggin in this @zroubalik !!! |
Can I get an example of passing the value? |
Report
When using 'Value' in the CPU scaler (in addition to SQS scaler), the keda hpa can't be intiailized, and logs show error in K8s hpa. When switching back to "Utilization" instead of "Value" this seems to work, but it doesn't suit my usecase.
My configuration is as follows:
And this is the outcome YAML in the HPA
Expected Behavior
The autoscaler should have been created with the "Value" target
Actual Behavior
The hpa fails to initialize / update
Steps to Reproduce the Problem
Logs from KEDA operator
KEDA Version
2.4.0
Kubernetes Version
1.20
Platform
Amazon Web Services
Scaler Details
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: