Opscraft
Containers

Docker Swarm

Must-know10 lessons · 34 min · 3 tests ·

Docker Swarm mode is Docker's built-in orchestrator. It turns a group of Docker hosts into one cluster that keeps services at a desired number of replicas, spreads them across nodes, load-balances traffic to them, rolls out updates, and distributes secrets — all using the compose file format you already know. Few Bangalore teams run Swarm today, but interviewers still ask it to test orchestration fundamentals (desired state, consensus, scheduling, service discovery) and to see whether you can compare it honestly with Kubernetes.

Stage 2 · Core tools

Know these first

After this topic you can

  • Run services on a small Docker Swarm cluster
  • Perform rolling updates and manage secrets
  • Compare Swarm with Kubernetes honestly

Lessons

  1. 1What Swarm is and where it fits 3 min read
    • Swarm mode vs "classic Swarm"
    • Why learn it
  2. 2Architecture: managers, workers and Raft 5 min read
    • Node roles
    • Raft and quorum
    • Built-in security (PKI)
    • Ports to open between nodes
  3. 3Services, tasks and scheduling 5 min read
    • The desired-state model
    • Replicated vs global
    • Placement
    • Node availability
  4. 4Networking and the routing mesh 3 min read
    • Overlay networks
    • Service discovery: VIP vs DNS round robin
    • The ingress routing mesh
  5. 5Stacks: compose files for the cluster 3 min read
    • Deploying a stack
    • The deploy section
  6. 6Secrets and configs 3 min read
    • Swarm secrets
    • Configs
  7. 7Rolling updates, health and rollback 3 min read
    • How an update rolls
  8. 8Operating a swarm 3 min read
    • Backup and restore
    • Storage for stateful services
    • Upgrading Docker across the cluster
    • Monitoring and logging
  9. 9Troubleshooting and choosing an orchestrator 3 min read
    • Common problems
    • Swarm vs Kubernetes vs ECS
  10. 10Interview questions and model answers 3 min read
    • "Why should a swarm have an odd number of managers?"
    • "What happens if the swarm loses quorum?"
    • "Explain the routing mesh."
    • "How does Swarm handle secrets, and how do you rotate one?"
    • "How do you do a zero-downtime update in Swarm?"
    • "Containers on two nodes can't reach each other over an overlay. What do you check?"
    • "Swarm or Kubernetes for a new platform?"