Below are the setup details: keda installed, prometheus deployed, through application using below scaled object template for hpa:
keda:
triggers:
- metadata:
metricName: container_memory_usage
query: avg(floor((container_memory_usage_bytes{pod=~"pythonb-.*",container=~"proxy"} / container_spec_memory_limit_bytes != +Inf) * 100))
serverAddress: <serveraddress>
threshold: '70'
type: prometheus
basically we want to scale the deployment based on the given prom query.(based on container memory utilisation of particular pods..if it exceeds 70% then hpa will scale the pods. ) when we try the above query on Prometheus it returns the results as 8., 10.. , 25.3. Basically single element response But though keda it gives the result as below:
kubectl get hpa -n integration keda-pythonb
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
keda-pythonb Deployment/pythonb 3500m/70 (avg), 34%/87% + 1 more... 2 10 2 14m
Instead of single value it gives 3500m as current value. does keda convert the data returned from prom query? Any pointers would be helpful. I hope the prom query is correct.