Skip to content
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

EHPA cron can't scale to specified replicas,because hpa within a globally-configurable tolerance, 0.1 by default #836

Open
chenshiwei-io opened this issue Jul 18, 2023 · 2 comments
Labels
kind/bug Something isn't working

Comments

@chenshiwei-io
Copy link

chenshiwei-io commented Jul 18, 2023

Describe the bug
The Kubernetes Horizontal Pod Autoscaler (HPA) has a default tolerance of 0.1. In EHPA, the cron-based scaling may not scale up or down to the desired number of replicas. For example, if the scheduled scaling is set to 24 replicas but it only scales up to 22, the calculation becomes 24/22 = 1.09. Since 0.09 falls within the tolerance range, it stops further scaling.

Reproduce steps

Expected behavior

Screenshots

Environment (please complete the following information):

  • K8S Version: [e.g. 1.19]
  • Crane Version: [e.g. 0.1.0]
  • Browser [e.g. chrome, safari]
@chenshiwei-io chenshiwei-io added the kind/bug Something isn't working label Jul 18, 2023
@qmhu
Copy link
Member

qmhu commented Jul 19, 2023

emm.. indeed.
@mfanjie any idea?

@whitebear009
Copy link
Contributor

In my opinion, if the tolerance is set and it is really needed, there is no requirement for the specific number of instances (22 or 24 is fine). So we don't need to change it, just doc it.
In other scenarios, a precise number of instances is really needed, we can set specficReplicas based on cron rules. At this time, because a precise number of instances is required, the feature provided by cronHPA that can work together with cron rules and other indicators is no longer needed.

We can provide an option in cron to indicate whether we need to strictly follow cron rules. @qmhu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants