chapter thirteen

13 Orchestrate Services on a Cluster of Docker Hosts with Swarm

 

This chapter covers:

  • How Docker application deployments work and options
  • Deploying a multi-tier application to Docker Swarm
  • How Swarm attempts to converge the Docker application deployment to the desired state declared by operators
  • How Swarm ensures the desired number of replicas are running around the cluster within the declared placement and resource constraints
  • Routing of request traffic from a cluster node to network service instances and how collaborating services reach each other using Docker networks
  • Controlling placement of Docker Service containers within the cluster

13.1   Clustering with Docker Swarm

13.1.1   Introducing Docker Swarm Mode

13.1.2   Deploying a Swarm Cluster

13.2   Deploy an Application to a Swarm Cluster

13.2.1   Introducing Docker Swarm Cluster Resource Types

13.2.2   Define an Application and its Dependencies Using Docker Services Service

13.2.3   Deploy the Application

13.3   Communicating with Services Running on a Swarm cluster

13.3.1   Routing Client Requests to Services Using the Swarm Routing Mesh

13.3.2   Overlay Networks

13.3.3   Discovering Services on an Overlay Network

13.3.4   Isolating Service-Service Communication with Overlay Networks

13.3.5   Load Balancing

13.4   Placing Service Tasks on the Cluster

13.4.1   Replicated Services

13.4.2   Constraining Where Tasks Run

13.4.3   Global Services for One Task per Node

13.4.4   Deployment of Real Applications Onto Real Clusters

13.5   Summary