-
Notifications
You must be signed in to change notification settings - Fork 40.6k
HPA doesn't scale down to minReplicas even though metric is under target #78761
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
Comments
@kubernetes/sig-autoscaling-bugs |
@max-rocket-internet: Reiterating the mentions to trigger a notification: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
If I scale down manually:
And these are the resources specified in the deployment: resources:
limits:
cpu: 2048m
memory: 4Gi
requests:
cpu: 2048m
memory: 4Gi |
Can you attach log to this issue ? thanks |
Hi @tedyu I am using AWS EKS so the only HPA related log entries I can see are like this and nothing more:
|
@tedyu Is there some other way I can get more debug information? |
There are logs at higher verbosity. e.g. (not that this would be logged in your cluster)
See if you can tune up verbosity |
@tedyu thanks for the suggestion but I don't think we have that option on EKS as it's K8S service: https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html I guess I have to chase it up with AWS support? |
Our deployment strategy could be also relevant: spec:
strategy:
rollingUpdate:
maxSurge: 100%
maxUnavailable: 0
type: RollingUpdate |
Just look at these events and missing
|
I'm having the exact same issue as you @max-rocket-internet, also running on EKS with their latest version available to date. This is frustrating :( |
@vdemonchy There may be sudden bursts of traffic,some times cause CPUUtilization to 100% , in this case,it won't scale down |
This is not the case. |
The pod is all ready? If there were any missing metrics, we recompute the average more conservatively, assuming those pods were consuming 100% of the desired value in case of a scale down, and 0% in case of a scale up. |
@max-rocket-internet Try increasing your metrics resolution from the default. I was experienceing similar behavior, I added the flag As @SocietyCao said, in my case it appears that the HPA was rapidly scaling up my service, creating a bunch of pods that didn't have any metrics yet, which in turn caused the HPA to assume the pods were under load. Seems like it can create a feedback loop of sorts. |
We are seeing the same behavior. Has this issue been resolved? |
@wxwang33 What is your metrics-server resolution set to? That fixed it for me (on 1.14.6). |
I will check later as I don't have direct access to it. Will update and thanks for the quick response! |
I am having the same, issue , at first i thought its not scaling down, but as time went by , exactly 6 minutes , hpa scaled down the pods. |
still an issue |
This is also an issue for us with the HPA when using 2 metrics. We haven't tried setting the threshold to double the expected size to see if this makes a difference. |
OT - which dashboard is that? |
Based on my experience, the key factor is that the metric is based on the Requested, not the Limit. Then, the condition to match is the Usage vs Request and the scale criteria. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
Seeing this in kubernetes 1.21 when using custom metrics. The metric drops below target and the HPA responds by scaling up.
|
I facing the same issue Scale down not working for me NAME READY STATUS RESTARTS AGE NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE |
Having the same issues with some HPA in 1.21 using API |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/remove-lifecycle rotten this is still a valid issue |
/reopen |
@h0jeZvgoxFepBQ2C: You can't reopen an issue/PR unless you authored it or you are a collaborator. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Could someone reopen this issue? I'm not allowed to do it |
Yeah, this issue needs to be reopened as this is a blocker for using memory HPA in Kubernetes. |
Any news? |
@liggitt @wojtek-t @pohly @smarterclayton Could anyone of you reopen this issue maybe? |
Is there any update on this? |
@markandersontrocme Still got same issue on Kubernetes 1.24 with |
So much has changed in Kubernetes since I opened this issue but I guess some things never change: I have this issue again 😅 |
It seems some others also have the same problem. Rather than reopen an old issue with tonnes of comments I've created a new one to start fresh with |
What happened:
HPA scales to
Spec.MaxReplicas
even though metric is always under target.Here's the HPA in YAML:
And here's a description output:
What you expected to happen:
HPA only scales up when metric is above target and scales down when under until
Spec.MinReplicas
is reached.How to reproduce it (as minimally and precisely as possible):
I'm not sure. We have 9 HPAs and only one has this problem. I can't see anything unique about this HPA when comparing to the others. If I delete and recreate the HPA using Helm, same problem. Also if I recreate the HPA using
kubectl autoscale Deployment/my-app-1 --min=2 --max=4 --cpu-percent=40
same problem.Environment:
kubectl version
):v1.12.6-eks-d69f1b
cat /etc/os-release
): EKS AMI releasev20190327
uname -a
):4.14.104-95.84.amzn2.x86_64
0.3.2
The text was updated successfully, but these errors were encountered: