jrasell / sherpa

Sherpa is a highly available, fast, and flexible horizontal job scaling for HashiCorp Nomad. It is capable of running in a number of different modes to suit different requirements, and can scale based on Nomad resource metrics or external sources.
Mozilla Public License 2.0
163 stars 8 forks source link

scheduled scaling of task groups #117

Open jrasell opened 4 years ago

jrasell commented 4 years ago

Is your feature request related to a problem? Please describe. Tasks that have clear and observable load patterns could benefit from scheduled autoscaling. This feature would allow the task in question, to run at a minimal cost during quiet hours, and then increase its count to handle the known traffic as required. A clear use case would be CI/CD build agents; which would be scaled down out of office hours, and then scheduled to scale up just before the start of the work day.

In order to ensure this feature is most useful, it would likely be a requirement to remove the policy min count merge default and allow setting of zero.

Describe the solution you'd like. The scaling policy structure would need a new parameter which allows for the definition of scheduled actions. Internally, the autoscaler would need to run a new thread, which would periodically trigger scaling actions based on the desired state.

AWS - https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html Azure - https://docs.microsoft.com/en-us/azure/azure-monitor/learn/tutorial-autoscale-performance-schedule GCP - https://cloud.google.com/scheduler/docs/start-and-stop-compute-engine-instances-on-a-schedule