Run an ECS Cluster on Spot Instances in 3 Steps
In this tutorial, you will learn how to run your ECS cluster on Amazon EC2 Spot instances, using the Elastigroup Managed Container Service (MCS) creation wizard.
Elastigroup MCS lets you run ECS clusters on Spot instances, without having to manage the underlying servers.
Containerized applications in general, and ECS services in particular, are fault tolerant by nature, making them ideal candidates for Spot Instances. With Spot Instances, you can achieve substantial cost savings (up to 90%) without compromising on performance or availability. And with Spotinst MCS, there is no need to provision, manage or scale instances – we take care of all that for you.
You are now minutes away from running your ECS cluster on Spot Instances. Let’s get started!
- A verified Spotinst Account.
- An ECS cluster.
Step 1: Open the ECS MCS creation wizard
Login to the Elastigroup Console (console.spotinst.com) and navigate to the Creation Wizard by clicking on the Create button in the Elastigroups tab.
Then, choose ‘ECS’ to launch the ECS MCS creation wizard:
Step 2: Import Cluster Configuration
With MCS, you can get started quickly by importing instance configuration from existing instances. MCS will import instance configurations such as AMI, security groups, and VPC. For a full list of configurations imported by MCS, visit our docs.
You can select an existing ECS cluster to import:
Once you’ve selected an ECS to import configuration from, click on ‘Next’
Step 3: Configure your cluster
In this step, all the current configurations of your existing ECS cluster are imported automatically and can be configured as follows:
- The ‘target’ is the initially desired number of instances.
- The ‘minimum’ is the low boundary for your cluster size. Elastigroup will not scale below the minimum you set.
- The ‘maximum’ is the high boundary for your cluster size. Elastigroup will not scale above the maximum you set.
Next, we will select multiple ‘Spot types’ – these are instance types that you deem suitable for your ECS cluster, based on the RAM and CPU that your applications are expected to consume.
Finally, you will need to select the availability zones and subnets in which your instances will be provisioned.
On the top right, you will find the Spotinst Spot Market scoring. Spotinst’s proprietary algorithms take into account vast amounts of availability and pricing data in order to provide scores for each Spot market (between 0 and 100), based on the market’s attractiveness. Spotinst then uses these scores to ensure your instances are provisioned in the markets that are the most cost-effective, and the least likely to get interrupted.
NOTE: Each Spot market is a combination of an AZ and instance type. It is recommended to enable as many Spot markets as possible (i.e. add instance types or AZs) for optimal performance and minimal costs.
When done, press ‘Create’ on the bottom right of the screen.
You have now learned how to create an ECS cluster on Spot instances with Spotinst, letting you:
- Cut your costs by up to 80%, while maintaining high availability.
- Run on spot instances with zero overhead, and no servers to manage – The Spotinst Elastigroup platform manages your infrastructure for you.
- Enjoy a Hands-free scaling experience – no need to define scaling policies; Spotinst MCS will automatically scale your cluster up and down for optimized performance, and minimal costs.
Now that you have learned to deploy your ECS cluster on Spot Instances with Spotinst, try Spotinst for other workloads.