jthomperoo / predictive-horizontal-pod-autoscaler

Horizontal Pod Autoscaler built with predictive abilities using statistical models
Apache License 2.0
330 stars 30 forks source link

failed to get resource metric #60

Closed MarahAbu closed 2 years ago

MarahAbu commented 2 years ago

Hi, I see this error in cpa pod logs: "Shell command failed, stderr: 2022/01/30 13:29:20 invalid metrics (1 invalid out of 1), first error is: failed to get resource metric: unable to get metrics for resource cpu: no metrics returned from resource metrics API"

Steps to reproduce the behavior:

  1. Deploy latest phpa

Additional context Can you please check if you have this error in your logs and if it really affects the phpa?

jthomperoo commented 2 years ago

Hi, thanks for raising this - sorry for the slow response, haven't been able to find recently to work on these projects.

This error is fine if the PHPA eventually starts working, this often happens when the resource you are scaling has not provided the metrics server with any metrics yet, so it will report no metrics. In a normal system this wouldn't happen (and isn't anything to worry about) since normally the resources are long running and will be providing metrics to the metrics server. The same error occurs behind the scenes for the normal Kubernetes Horizontal Pod Autoscaler.

Hope this helps!

If I've misunderstood/there's a further problem here, feel free to re-open this issue.

MarahAbu commented 1 year ago

Hi, I'm back on working on this but still can't proceed because of this issue, tried a few things but still it doesn't scale any pods even under a huge load, i would really appreciate it if we could have a demo or something to help. thanks in advance