When using spot instances across different public cloud providers, many products claim to be able to predict interruption times and proactively replace instances before they are interrupted. Is this really possible?
For example:

When using spot instances across different public cloud providers, many products claim to be able to predict interruption times and proactively replace instances before they are interrupted. Is this really possible?
For example:

“can” but then they say they are still training it.
Not sure why it needs to be AI and predict so early. I’ve seen services claim they can do this just using the built in warning from AWS
Thanks, bro
If you have processes that take longer than 2 minutes but shorter than 30 to gracefully kill (probably a lot of them) this wouldn’t hurt
True.
The service I saw claimed to be able to snapshot the machine within the two minutes and resume it on another. So there is a pause but no need to terminate the process.
To be fair, I don’t know if this service’s claims live up to the promises either.
You also have the rebalance recommendation, there is no guarantee of how early you will receive it, but it is worth a try.
Conceptually, if you have enough visibility into spot activity in a particular Region, you could build predictions based on when you start getting shutdown notifications–there’s probably more coming-- or if there are notifications that arrive on schedules (i.e., 7am Eastern time every morning).
This implies that interruptions still occur, and worse, during sudden spikes in capacity demand, instances may not have enough time to gradually evacuate or be rescheduled, leading to potential downtime or service degradation.
I was speaking in terms of how to build a predictive model, not how to keep spot interruptions from happening.
Got it
Karpenter for K8s handles this by having an sqs queue that is populated by an event bridge rule to notify a queue when an spot instance termination signal is sent.
This gives K8s about 2mins to provision another node and migrate workloads.
Works well, IMHO.
I’m a bit confused what the value prop is here: “if we predict your spot instance will be shut down, we’ll shut it down first”
If two minutes is ok in your scenario, interruption prediction is not necessary
Yep. We run hundreds of spot nodes and not a single outage caused by spot interruption
If the standard EC2 instance rebalance recommendation and Spot Instance interruption notice don’t suffice kfor any critical workloads, I would mainly rely on these two), this could help but as with any AI prediction, it won’t be perfect.
How are you doing node over-provisioning using Karpenter?
Not actually a Karpenter feature. Just create a deployment that uses registry.k8s.io/pause as the image and has the amount of overprovisioned resources as requests. It should also have a priorityclass with priority value -1. Then it just idles and reserves resources, and as soon as some service with a normal priorityclass needs the resources, it gets terminated and rescheduled, which will lead to Karpenter launching a new node to house it.
You can also quickly scale the overprovisioning amount by increasing the replica count of the overprovisioning-deployment.
It can work but the problem is it works at the capacity pool level.
The question is how do you handle it when it triggers a notification that the entire capacity pool is in danger of termination? Will you starts replacing all your instances from that capacity pool at once?
Chances are if you don’t use any such recommendations and just let instances to be terminated, only a small subset of them will actually be claimed by AWS, which is much less disruptive than a massive reshuffling of everything.
I’m building a Spot orchestration product for almost a decade now and also for a while used to work at AWS as Specialist Solution Architect for Spot.
Many AWS customers using the rebalancing recommendation events were impacted when their entire capacity was replaced, and I repeatedly saw the same with customers of my own product.
I eventually changed my product to just let the instances get terminated. Nobody complained afterwards about not having enough capacity.