Pods on preemptible or spot instance Nodes: How to schedule them on the Node with the lowest age?

Hello everybody,

is there a way to get from the Api the Node with the most recent creationTimestamp (or lowest age),
so that, in case of Nodes running on preemptible VMs or spot instances,
the Pod has a higher chance of running uninterrupted for the highest amount of hours possible?

Thank you!

You can create a custom scheduler that takes the node uptime into account.

You can also play with the scheduling policies, for example, using a floating label that is only in the newest node and using that to filter or prioritize the new node with policies. This is a hack, but avoids implementing a custom scheduler.

1 Like