Docker Swarm is a native integrated feature of the Docker Engine, providing cluster management and container orchestration features that allow you to run Docker containers at scale in production. Every Docker Engine running version 1.13 or greater includes the ability to operate in swarm mode, which provides the following features:
- Cluster management: All nodes operating in swarm mode include native cluster features that allow you to quickly establish clusters that you can deploy your applications to.
- Multi-host networking: Docker supports overlay networking that allows you to create virtual networks over which all containers attached to the network can communicate privately. This networking layer is completely independent of the physical networking topology that connects your Docker Engines, meaning you typically don't have to worry about traditional networking constraints such as IP addressing and network segmentation—Docker takes care of all of this for you.
- Service discovery and load balancing: Docker Swarm supports a simple service discovery model based upon DNS that allows your applications to discover each other without requiring complex service discovery protocols or infrastructure. Docker Swarm also supports automatic load balancing of traffic to your applications using DNS round robin, and can integrate with an external load balancer such as the AWS Elastic Load Balancer service.
- Service scaling and rolling updates: You can easily scale your services up and down, and when it's time to update your services, Docker supports intelligent rolling update features with support for rollbacks in the event of a deployment failure.
- Declarative service model: Docker Swarm uses the popular Docker Compose specification to declaratively define application services, networks, volumes, and more in an easy to understand and maintained format.
- Desired state: Docker Swarm continuously monitors application and runtime state, ensuring that your services are operating in accordance with the desired state you have configured. For example, if you configure a service with an instance or replica count of 2, Docker Swarm will always try and maintain this count and automatically deploy new replicas to a new node when an existing node fails.
- Production-grade operational features such as secrets and configuration management: Some features such as Docker secrets and Docker configurations are exclusive to Docker Swarm, and provide solutions for real-world production issues such as the ability to securely distribute secrets and configuration data to your applications.
When it comes to running Docker Swarm on AWS, Docker provides a community edition offering referred to as Docker for AWS CE, which you can find further information about at https://store.docker.com/editions/community/docker-ce-aws. At present, Docker for AWS CE is deployed via a pre-defined CloudFormation template that integrates Docker Swarm with a number of AWS services, including EC2 Auto Scaling, Elastic Load Balancing, Elastic File System, and Elastic Block Store. As you will soon see, this makes it very easy to stand up a new Docker Swarm cluster in AWS.