Kubernetes isn't the only orchestrator. Docker Swarm ships with Docker itself, Nomad handles mixed workloads elegantly, ECS is deeply AWS-native, and serverless containers remove ops entirely. This lesson maps the landscape so you can choose the right tool for your context.
1. Docker Swarm
Swarm mode is built directly into the Docker Engine — no extra binaries to install. One command bootstraps a production-ready cluster:
docker swarm init --advertise-addr 192.168.1.10
Core Concepts
- Manager nodes — maintain cluster state via Raft consensus; schedule tasks
- Worker nodes — execute containers assigned by managers
- Services — desired state declaration (image, replicas, ports, update policy)
- Tasks — individual container instances of a service
- Overlay networks — multi-host encrypted networking between services
Key Commands
# Create a service with 3 replicas
docker service create --name web --replicas 3 -p 80:80 nginx:alpine
# Scale the service
docker service scale web=5
# Rolling update
docker service update --image nginx:1.25 --update-parallelism 2 --update-delay 10s web
# Inspect cluster
docker node ls
Swarm Architecture
2. Swarm vs Kubernetes
| Attribute | Docker Swarm | Kubernetes |
|---|---|---|
| Setup complexity | One command | Multiple components (etcd, API server, scheduler, kubelet…) |
| Learning curve | Low — familiar Docker CLI | Steep — many abstractions (Pods, Deployments, Services, Ingress…) |
| Auto-scaling | Manual scaling only | HPA, VPA, cluster autoscaler |
| Networking | Built-in overlay + ingress routing mesh | CNI plugins, service mesh ecosystem |
| Ecosystem | Small, Docker-centric | Massive (Helm, operators, CRDs, CNCF projects) |
| Scaling limits | ~1,000 nodes practically | 5,000+ nodes tested |
| Production adoption | Declining | Industry standard |
| Best for | Small teams, simple apps, Docker-native workflows | Complex microservices, multi-team, enterprise |
When Swarm makes sense: You have a small team, simple deployment topology, already use Docker Compose, and don't need advanced scheduling, auto-scaling, or a massive plugin ecosystem.
3. HashiCorp Nomad
Nomad is a workload orchestrator — not just for containers. It schedules Docker containers, raw binaries, Java JARs, VMs (QEMU), and more through a unified interface.
Key Differentiators
- Single binary — one binary for both server and client; trivial to deploy
- Multi-workload — containers, VMs, batch jobs, system daemons all in one scheduler
- HashiCorp ecosystem — native integration with Consul (service discovery), Vault (secrets), Terraform (provisioning)
- Federation — built-in multi-region, multi-datacenter support
- Simpler model — jobs → task groups → tasks (fewer abstractions than K8s)
Example Job File
job "web" {
datacenters = ["dc1"]
type = "service"
group "app" {
count = 3
network {
port "http" { to = 8080 }
}
task "server" {
driver = "docker"
config {
image = "myapp:1.4"
ports = ["http"]
}
resources {
cpu = 500
memory = 256
}
}
}
}
When to choose Nomad: Mixed workloads (not just containers), simplicity-focused ops teams, already invested in HashiCorp tooling, or teams that find K8s overkill but need more than Swarm.
4. Amazon ECS
ECS is AWS's native container orchestrator — deeply integrated with the AWS ecosystem but locked to a single cloud.
Core Concepts
- Task Definition — like a pod spec: container images, CPU/memory, ports, environment
- Service — maintains desired count of tasks, handles rolling deploys
- Cluster — logical grouping of resources
- Launch Types:
- EC2 — you manage the instances; more control, more ops burden
- Fargate — serverless; AWS manages compute; you just define tasks
AWS Integration
- ALB/NLB — native load balancer target groups
- CloudWatch — logs and metrics out of the box
- IAM roles — per-task IAM roles for fine-grained permissions
- ECR — private registry with vulnerability scanning
- App Mesh — service mesh integration
When to choose ECS: All-in on AWS, want managed infrastructure without K8s complexity, comfortable with AWS vendor lock-in, small-to-medium service count.
5. Serverless Containers
The newest evolution: push a container image, the platform handles everything else — scaling, networking, TLS, infrastructure.
| Platform | Cloud | Scale to Zero | Max Instances | Key Feature |
|---|---|---|---|---|
| Cloud Run | GCP | Yes | 1,000 | Request-based billing, instant deploys |
| Fargate | AWS | No (min 1 with ECS) | Thousands | Deep AWS integration |
| Container Apps | Azure | Yes | 300 | KEDA-based autoscaling, Dapr integration |
Cloud Run Example
# Deploy a container to Cloud Run
gcloud run deploy my-service \
--image gcr.io/my-project/my-app:1.0 \
--region us-central1 \
--allow-unauthenticated \
--max-instances 10 \
--memory 512Mi
When to choose serverless containers: Event-driven workloads, variable/spiky traffic, no dedicated ops team, cost optimization for low-traffic services, rapid prototyping.
6. Choosing an Orchestrator
Comparison Matrix
| Attribute | Swarm | Kubernetes | Nomad | ECS | Serverless |
|---|---|---|---|---|---|
| Setup effort | ⭐ | ⭐⭐⭐⭐ | ⭐⭐ | ⭐⭐ | ⭐ |
| Feature richness | ⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ |
| Multi-cloud | Yes | Yes | Yes | No | No |
| Non-container workloads | No | Limited | Yes | No | No |
| Ops burden | Low | High (self-managed) / Low (managed) | Low-Medium | Low | Minimal |
| Vendor lock-in | None | None | None | High (AWS) | High |
| Community/ecosystem | Small | Massive | Medium | AWS-centric | Growing |
Decision Framework
- Team < 5 engineers, simple app? → Swarm or serverless containers
- All-in on AWS, want managed? → ECS with Fargate
- Mixed workloads (containers + VMs + batch)? → Nomad
- Multi-cloud, complex microservices, large team? → Kubernetes (managed: EKS/GKE/AKS)
- Event-driven, variable traffic, no ops? → Cloud Run / Container Apps
- Need maximum ecosystem and portability? → Kubernetes
🧪 Hands-On Task: Docker Swarm in Action
Initialize a Swarm, deploy a service, scale it, and perform a rolling update:
# Step 1: Initialize Swarm mode
docker swarm init
# Step 2: Deploy a service with 3 replicas
docker service create \
--name webapp \
--replicas 3 \
--publish 8080:80 \
--update-delay 10s \
--update-parallelism 1 \
nginx:1.24-alpine
# Step 3: Verify the service
docker service ls
docker service ps webapp
# Step 4: Scale to 5 replicas
docker service scale webapp=5
# Step 5: Verify scaling
docker service ps webapp
# Step 6: Perform a rolling update
docker service update \
--image nginx:1.25-alpine \
--update-parallelism 2 \
--update-delay 5s \
webapp
# Step 7: Watch the update progress
docker service ps webapp
# Step 8: Rollback if needed
docker service rollback webapp
# Cleanup
docker service rm webapp
docker swarm leave --force
What to observe: Tasks are spread across nodes (or a single node in dev). During rolling updates, old tasks shut down one-by-one as new ones start. The --update-parallelism and --update-delay flags control update speed.
🧠 Knowledge Check
📝 Key Takeaways
- Docker Swarm is the simplest orchestrator — built into Docker, one command to start — but has limited features and declining adoption
- Kubernetes is the industry standard with the largest ecosystem, but carries operational complexity (mitigated by managed offerings)
- Nomad uniquely handles mixed workloads (containers + VMs + binaries) with operational simplicity and HashiCorp ecosystem integration
- ECS is excellent for AWS-centric teams wanting managed container orchestration without K8s overhead
- Serverless containers eliminate ops entirely — ideal for event-driven, variable-traffic services
- The "best" orchestrator depends on team size, cloud strategy, workload types, and operational expertise — not hype