0

I have 16 microservices running in an ECS AWS Cluster. I have some EC2 instances mixed with spot instances. Some of the microservices are CORE, and should not be deployed on SPOT instances. How can I achieve to avoid deploying certain services on SPOT instances?

Kind regards

Jocheinfa
  • 25
  • 1
  • 4
  • https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html – Ermiya Eskandary May 02 '22 at 18:27
  • Hi @ErmiyaEskandary, I've checked the post but it is not specified how a specific task should not run on a SPOT instance. It mentions about weight, but not how to determine which task should run on spot and which on on-demand EC2. Kind regards – Jocheinfa May 02 '22 at 19:10
  • @Mark B has put it into more detail :) – Ermiya Eskandary May 02 '22 at 21:58

1 Answers1

2

As per the documentation linked in the comments, an ECS cluster can have multiple capacity providers. An individual capacity provider can specify (for example) EC2 only, EC2 and EC2 Spot, Fargate only, or Fargate and Fargate Spot. When you run your task, you can specify which of the configured capacity providers it should use. So you simply need to add a capacity provider to your ECS cluster that does not use Spot instances at all, and specify that capacity provider in your CORE services.

Mark B
  • 183,023
  • 24
  • 297
  • 295