Decision in brief
Trial Docker Swarm when a small operations team needs replicas and rolling updates across several Docker hosts with a short list of supporting services. Trial Kubernetes when you need its APIs, identity model, policy controls, or controllers, especially if a managed control plane is available. Keep a simpler deployment if host failure is already within the recovery target.

Compare the cluster features your workload needs
Swarm mode runs inside Docker Engine. Manager nodes use Raft to maintain cluster state, and services declare replica counts, placement, and rollout behavior. Three managers can lose one and maintain quorum. If a majority is unavailable, existing tasks can continue while cluster management and fresh scheduling stop. Account for the registry, ingress, secrets, and persistent storage when deciding how many systems your team must maintain.
Kubernetes Deployments manage interchangeable replicas through ReplicaSets. Readiness probes and rolling-update settings control when replicas can receive traffic and how quickly they are replaced. Failed rollout detection reports stalled progress. Define the recovery or rollback action in your delivery system. Kubernetes can expose more APIs through operators, but the specific networking and storage capabilities still depend on what your cluster runs.
Check your migration input. Docker documents that docker stack deploy uses the legacy Compose version 3 format. Validate the actual stack file and prebuilt images before assuming a Compose development file carries over to Swarm. Map dependencies to Kubernetes workload, service, and storage objects before estimating that migration.
| Requirement | Start with | Decision evidence |
|---|---|---|
| Replicated stateless services and a small Docker-oriented team | Swarm with three managers and the team's intended ingress and registry | Deploy from a clean checkout, lose one manager, and keep replica placement and new rollouts working. |
| Existing Helm charts, Kubernetes controllers, or fine-grained service roles | Kubernetes, using the intended distribution or managed offering | Verify the specific charts, readiness gates, and permissions in two test namespaces. |
| Data that must survive worker loss | Either cluster with an explicitly tested storage plan | Replace the worker holding a test instance and prove volume reattachment or data restoration to a new one. |
| One host meets the downtime and recovery target | Existing single-host deployment as the baseline | Time a rebuild from source and off-host backups before adding cluster maintenance. |
Two HN cases to turn into test criteria
In a Swarm-versus-Kubernetes discussion, raffraffraff described using K3s with Flux to deploy a Helm release from Git and get DNS and TLS shortly afterward. That setup depends on more than the orchestrator. Test the entire path from Git change to a working HTTPS endpoint before comparing delivery time.
In a separate Ask HN thread, blindlobstar described selecting Swarm for a small self-hosting tool and building a streamlined node setup around it. Their workflow points to a useful recovery test. Give the written node replacement steps to someone who did not write them and see if they can return capacity without intervention.
Run the same rollout and failure drill twice
Use a disposable cluster for each option and pin the same test image, resource requests, and traffic profile. Write down the downtime, recovery, and operator-effort limits before running the test.
- Deploy three replicas of a small HTTP service. Include the intended registry, ingress and TLS path. Record minutes from a new checkout to serving a test request.
- Apply a healthy image update and then one that fails the test readiness or health check. Compare failed requests and time to revert to the known-good version.
- Take one disposable worker offline during steady traffic. Time service recovery, then separately test one manager failure or the equivalent control-plane checks available in the managed test environment. Restore a synthetic stateful service from backup if the workload keeps data.
- Advance a candidate only when it passes the failure and rollback budgets with the intended operator on duty. For a small internal service, an example gate is under 1% failed requests during rollout and restored worker-loss capacity within five minutes. Stop if a critical dependency has no recovery owner.