arrow_back
Back

Docker Swarm: clustering, services, and tasks

Andrew Dorokhov Andrew Dorokhov schedule 2 min read
menu_book Table of Contents

Swarm is Docker’s built-in cluster manager. It groups several Docker hosts so you can treat them as one resource.

Two major components

  1. Enterprise-grade secure cluster

    • Manage one or more Docker nodes as a cluster.
    • Encrypted distributed cluster store.
    • Encrypted networks.
    • Secure join tokens.
  2. Orchestration engine for microservices

    • API for deploying and managing microservices.
    • Declarative manifest files.
    • Rolling updates, rollbacks, and scaling.

Nodes

A swarm consists of one or more Docker nodes. Each node is either a manager or a worker.

Managers:

  • Manage cluster state.
  • Dispatch tasks to workers.

Workers:

  • Accept and execute tasks.

State is stored in etcd.

Security

Swarm uses Transport Layer Security (TLS) for:

  • encrypted communication;
  • node authentication;
  • role authorization.

Services and tasks

The atomic scheduling unit is a swarm service. A service adds to a plain container:

  • scaling;
  • rolling updates;
  • rollback.

A container wrapped in a service is a task or replica.

A service is an application running in the swarm. It has a replica count — how many copies of the task to run.

A task is essentially one container scheduled on a swarm node.

Networking

In Swarm mode, Docker creates:

  • an ingress overlay network (default);
  • docker_gwbridge to connect node daemons.

See Networking for CNM and driver details.

code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

Docker Swarm commands: cluster, services, and stacks

arrow_forward