docker-archive / for-aws

92 stars 26 forks source link

Use spot instances #26

Open galindro opened 7 years ago

galindro commented 7 years ago

Expected behavior

It would be very nice to launch a spotfleet in place of autoscaling group for node (worker) nodes or, even better, make this choice configurable by the user. This will make AWS EC2 price more cheaper than using only on-demand instances.

Actual behavior

Today isn't possible to launch spot instances to be used in worker nodes.

arkaitzmugica commented 7 years ago

I agree

skymaster420 commented 7 years ago

+1

ccamp46 commented 7 years ago

+1

galindro commented 7 years ago

Guys, any return??

kencochrane commented 7 years ago

This isn't something we can support right now, we will need to wait until we convert to using infrakit, once we do that, it will be possible.

JohanVanHoye commented 7 years ago

Is it technically not possible to work with spot instances, or can the cloudformation template be manually customized to achieve it? If yes, does anyone have any guidance or code samples on how to do it? tx

kencochrane commented 7 years ago

@Eoan242 I'm not 100% sure, but I believe it is possible, you would just need to customize the template to support the spot instances.

JohanVanHoye commented 7 years ago

Thanks for that. I'm pretty new to all of this so "just need to customize the template" is at this point not within my powers... but with the help of some examples/tutorials I might be able to figure it out.

JohanVanHoye commented 7 years ago

FYI: Autospotting is a github project which addresses this requirement generically. https://github.com/cristim/autospotting It automatically brings up spot-bid instances which are compatible to the ones in your Docker for AWS Auto Scaling Groups; then yanks your on-demand swarm nodes out of the ASG one at a time, each time putting a spot equivalent in place. Have just been testing on my worker ASG and it seems to work quite well :)

kinghuang commented 6 years ago

Is there a timeline for when Docker for AWS will be converted to use InfraKit? I'm also very interested in launching worker nodes with spot instances, or even mixing them with on-demand instances.

FrenchBen commented 6 years ago

@kinghuang please checkout Infrakit's repo, for a spot-instance example: https://github.com/docker/infrakit/blob/master/examples/playbooks/aws/provision-spot-instance.yml

kinghuang commented 6 years ago

@FrenchBen Thanks, I'll take a look at that!