containers-roadmap icon indicating copy to clipboard operation
containers-roadmap copied to clipboard

[EKS] [request]: Spot instances for managed node groups

Open stijndehaes opened this issue 7 years ago • 58 comments

Tell us about your request Right now we can use on-demand instances in a managed node worker group. However I see no reference in the documentation to using spot instances or a spot fleet. Ideally, I would like to be able to use spot instances for my batch workloads.

Which service(s) is this request for? EKS

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? I want to run batch workloads cost efficiently. We mostly use spot instances for this. Without this feature I can't take advantage of the nice managed draining and upgrading support of the managed worker node groups.

Are you currently working around this issue? Creating our own autoscaling groups and manually doing a rolling upgrade using kubectl cordon and drain commands.

Additional context No

Attachments None


Update 12/1 – this feature is now available

stijndehaes avatar Nov 19 '19 05:11 stijndehaes

Thanks for adding this! We're working on this feature and its been part of our plan for managed nodes from the start.

Question: Would you expect to provision a spot node group with a single instance type or multiple instance types?

tabern avatar Nov 19 '19 07:11 tabern

@tabern Thanks for the quick answer! As to your question I would expect to be able to specify multiple instance types. At the moment we use launch template to specify multiple instance types and let it choose automatically. Providing the same support would be great. The reason we choose multiple instance types is resiliency, if one of those instance types is not available we can automatically switch.

stijndehaes avatar Nov 19 '19 07:11 stijndehaes

How about the new Fargate Spot option on EKS?

gjmveloso avatar Dec 04 '19 13:12 gjmveloso

How about the new Fargate Spot option on EKS?

I assume you are also talking about this announcement, however this just means you're running pods on fargate orchestrated by EKS, which is still quite expensive compared to running actual nodes, and does not integrate with typical k8s tooling such as EFK, Prometheus+Grafana, nginx ingress, cert manager, etc.

gertjangaillet avatar Dec 09 '19 08:12 gertjangaillet

I would expect to be able to specify multiple instance types. At the moment we use launch template to specify multiple instance types and let it choose automatically.

@stijndehaes would you expect to add any priority to these instance types or is random sufficient (ie: let cluster autoscaler scale up and we'll hit eventual capacity)? If we did not support multiple instance types per group would it be painful to need to create multiple node groups, some of which were scaled to 0 (and could be scaled up as needed) or would this create undue complexity?


How about the new Fargate Spot option on EKS?

@gjmveloso - that's on our roadmap, tracked as https://github.com/aws/containers-roadmap/issues/622


which is still quite expensive compared to running actual nodes

@gertjangaillet - The cost of Fargate tends to be dependent on cluster utilization. If you're getting very high utilization, Fargate is more expensive than nodes. However, if you typically run with low cluster utilization (50% or much less is very common), Fargate is more efficient. We're also bringing Savings Plan to EKS/Fargate (https://github.com/aws/containers-roadmap/issues/616) which is another great way to lower costs.

tabern avatar Dec 16 '19 16:12 tabern

@tabern to start with random would be sufficient. However I would be most interested in the option to launch the cheapest instance type. I mostly use a couple of different instance types that roughly have the same cpu/memory. For example: m5.xlarge, m5a.xlarge, m5d.xlarge. This makes it sure that all jobs land on instances with roughly the same power available to them. Also this used to be very important for the kubernetes cluster autoscaler because it uses one of the nodes as a template to see if a new pod would fit that node. I am not sure if this is still the case though (but I guess it is).

stijndehaes avatar Dec 17 '19 06:12 stijndehaes

We would be interested in specifying a 'Capacity-Optimised' allocation strategy, as we have seen instability in Spot using 'Lowest-price' as we have suffered from losing instances within a given AZ then getting then back again, and losing them again where that instance type in that AZ is near exhaustion. We have therefore moved to diversified pools of instances matching the same capacity requirements, with a Capacity-Optimised strategy, i.e. we are willing to take a hit on getting the cheapest spot for stability.

mambetica avatar Dec 19 '19 12:12 mambetica

When can we expect this?

jurgenweber avatar Jan 08 '20 02:01 jurgenweber

Is there an ETA to release this feature? We're interested in migrating from Kops to EKS Managed, but not having Spot Instances is going to increase all of our pre-environments costs, which is a no-go.

AndresPineros avatar Jan 14 '20 04:01 AndresPineros

This would be a really outstanding important feature, hope it comes soon :)

sandrom avatar Jan 14 '20 16:01 sandrom

+1 to this, essential feature IMO.

leepatrick-goop avatar Jan 24 '20 00:01 leepatrick-goop

o release this feature? We're interested in migrating from Kops to EKS Managed, but not having Spot Instances is going to increase all of our pre-environments costs, which is a no-go.

I'd suggest checking out this workshop and https://ec2spotworkshops.com/using_ec2_spot_instances_with_eks.html and this blog post https://itnext.io/the-definitive-guide-to-running-ec2-spot-instances-as-kubernetes-worker-nodes-68ef2095e767.

ruecarlo avatar Feb 02 '20 12:02 ruecarlo

Agreed that this is an essential EKS offering especially to support development pipelines. Make it so!

jonathanoliver80 avatar Feb 07 '20 00:02 jonathanoliver80

Any update on this item?

igrowheart avatar Feb 13 '20 06:02 igrowheart

Any update please?

jayolmos avatar Mar 06 '20 09:03 jayolmos

Hi, are there some new about this topic?

lsantana486 avatar Mar 12 '20 17:03 lsantana486

This would be pretty useful given widespread industry mandates to cut costs right now .....

casey-robertson avatar Mar 23 '20 19:03 casey-robertson

any updates? It would help us keep out cost low on EKS cluster which we plan to use for our CI builds.

gauravkohli avatar Mar 27 '20 10:03 gauravkohli

@tabern after moving to eks on reserved instances we are now thinking of leveraging spot instances. We do use cluster autoscaler on production today. If we have 2 node groups and if i were to set precedence for "spot" worker node groups (over reserved) to expand first and only if that is not successful i would like to go to reserved instances. To make this happen in understand i would have to implement something like this https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/expander/priority/readme.md

This, in my opinion, can also work with SpotAllocationStrategy set to capacity-optimized

So i think implementing priority based expander is important.

pc-rshetty avatar Mar 30 '20 07:03 pc-rshetty

@casey-robertson 👍. Any update regarding the support of spot instances on managed node group ?

antiqe avatar Apr 04 '20 09:04 antiqe