deislabs / osiris

A general purpose, scale-to-zero component for Kubernetes
MIT License
464 stars 51 forks source link

Is there an annotation available to increase idle time for scale-down to zero #32

Closed dhruvservana closed 5 years ago

dhruvservana commented 5 years ago

Question: Dear team, is there a configurable option for default idle timeout to scale down to zero? Please let me know, if osiris supports statefulset?

dhruvservana commented 5 years ago

Found the answer by looking at the source. Thank you! metricsCheckInterval: 300

krancour commented 5 years ago

Please let me know, if osiris supports statefulset?

It doesn't, currently. I don't we had predicted any demand for scaling stateful workloads to zero... but I suppose that could still be a legitimate use case.

There aren't a lot of resources going into this project at the moment, but we'd probably accept a contribution that adds support for stateful sets.

I can give a hint that it's mainly the zeroscaler and the activator that you would have to fiddle with. In the case of the zeroscaler, it currently watches deployments and for each one that is both osiris-enabled and currently has the minimum number of pods (1 by default), it starts scraping metrics from those pods to determine when it's finally safe to scale to zero. You'd have to amend this component to basically watch osiris-enabled statefulsets and initiate all that same monitoring. Nearly all of what's already there should be reusable as-is, so this isn't a huge change.

In the case of the activator, currently, an annotation is used to point osiris-enabled services at the deployment that needs to scale up from zero on activation. You're going to have new cases where activation needs to scale a statefulset up from zero instead. So you'd have to add a new annotation for that and appropriate logic for handling it. Not trivial, but not major either. Again-- most existing code can probably be used as-is.

dhruvservana commented 5 years ago

@krancour Thanks! Appreciate your support on providing the details abt the query. Could you please share the instructions to build the source code? It would definitely save a lot of time to figure out on my own :)

krancour commented 5 years ago

As long as you have make and Docker installed, make test-unit, make lint, and make build are the main things you need to know and should "just work" as long as you're using Mac OS, Linux, or Windows Subsystem for Linux.

dhruvservana commented 5 years ago

ok cool. Thanks for sharing. I got the sequence from ci config.yml.