Spotinst raises $15M Series A Led By Intel Capital and Vertex Ventures Read The Official Press Release

Leverage Spot Instances with Docker Swarm

How to save 80% on your cloud costs using Docker

Aviv Shukron
Product Manager, Elastigroup

Introduced in Docker engine v1.12, Swarm is Docker’s native support for orchestrating clusters of Docker engines. A Docker Swarm is a cluster of Docker engines, referred as nodes, which hosts services and tasks. Originally launched as a separate tool, Swarm now ships native with the Docker engine you’re already going to install and use. Hitting the sweet spot between super-easy setup and solid feature set, you owe it to yourself to check it out.

Today we are happy to announce that Docker Swarm has joined the long list of container management solutions supported by Spotinst (alongside other leading solutions- Kubernetes, Amazon ECS, Rancher, Mesosphere and more).

Why you should run your Docker Swarm Cluster on Spot Instances

As Spotinst vets already know, running your applications on Spot Instances saves you a lot of money.

Containers make the perfect use case for leveraging Spot instances, This is due to the fact that containers provide customers with the confidence to seamlessly deploy the same application to new hosts. The self-contained dependency model means that everything your application needs is available as part of a compressed archive (Docker Image) that is created upon build. This is especially true when running containerized applications on a cluster, such as Docker Swarm, that can automatically reschedule failed jobs and applications.

High-Level Architecture

Each node in a swarm has a role: a Manager or a Worker.

  • Manager nodes handle cluster management tasks:
    • Maintain cluster state
    • Schedule services
    • Serve swarm mode HTTP API endpoints
    • Service discovery
  • Worker nodes whole purpose is executing tasks 

Docker Swarm architecture

Integration with Elastigroup

Elastigroup lets you run Docker Swarm workers on EC2 spot instances in a reliable and cost-effective manner. Taking advantage of our predictive algorithm to identify interruptions in the spot market and operate in proactive fashion – replacing the interrupted spot instance with another one, gracefully. All with zero downtime.

Once an interruption is predicted, the relevant instance is marked for draining, another instance is launched and automatically joined to the swarm. The interrupted instance’s tasks are being rescheduled across the cluster.

Docker Swarm on Spot Instances

Getting Started with Docker Swarm on Spotinst

  1. Log in to your Spotinst console. (https://console.spotinst.com)
  2. Create a new elastigroup or edit an existing group, in the compute page scroll down to the Integrations section.
  3. Select Docker Swarm and enter the API URL and Port.
  4. Click Test connection to validate connectivity.

Docker Swarm Spotinst Integration

Whats next for Docker Swarm on Spotinst?

There’s a lot more to expect if you are a Docker Swarm user. Scheduled for Q4 of 2017 are designated dashboards and improved visibility of your Swarm deployments. And our tailor-made Swarm auto-scaler will allow you to scale Docker Swarm more cost-effectively than ever before.

So what are you waiting for? Get your Swarm running on Spotinst now!

Aviv Shukron
Product Manager, Elastigroup

Stay current

Sign up for our newsletter, and we'll send you the latest updates on Spotinst, tips, tutorials and more cool stuff!