Open consideRatio opened 5 years ago
I think this is a great idea.
As far as I understand, the current implementation of "permanent" placeholders is mainly useful if the number of users varies slowly over a node startup time (i.e. number of new users arriving within 5 minutes is always small compared to the total number of users on the system). Otherwise, you either need many placeholders (expensive) or your users will encounter the node startup delay.
A possible alternative to the proposal of scheduled pre-warming would be the concept of "one-time" placeholders that simply do not reschedule after they've been taken over. An admin would add those one-time placeholders to the system a couple of minutes before an increase in the number of users is expected.
I don't know whether that would be easier or harder from a kubernetes perspective; either approach would be a solution to the use case.
To optimize costs further, one could make user-placeholder pods come and pre-warm some seats at the start of the day, and then leave at the end of the day. That way, one could avoid making users needing to wait for scale-up events during the day, but scale down properly during the night.
For something like this, I imagine a CRD + Controller binary pod running inspecting the CRD. The CRD would then specify at what kind of time one needs certain user placeholders somehow, perhaps using a cron-syntax or similar.
An example controller using a CRD can be found here: https://github.com/kubernetes/sample-controller