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
CodePudding user response:
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.