How does Kubernetes differ from Docker Swarm, and why did Kubernetes win?
Quick Answer
Both orchestrate containers, but Kubernetes offers a far richer, extensible model — custom resources, operators, fine-grained scheduling, a huge ecosystem — while Swarm is simpler but limited. Kubernetes won on extensibility and community/cloud backing.
Detailed Answer
Docker Swarm is easy to stand up and uses the familiar Docker CLI, which made it attractive early. But it stayed intentionally simple: basic scheduling, limited extensibility, and a small ecosystem. Kubernetes is more complex to learn but is built around an extensible API — Custom Resource Definitions and the operator pattern let you teach the cluster about your own objects, and features like affinity/anti-affinity, taints/tolerations, admission control, and a rich RBAC model give you deep operational control. Every major cloud offers managed Kubernetes (EKS/GKE/AKS), and the CNCF ecosystem (Helm, Prometheus, Istio, Argo) standardized on it. So the win was less about day-one simplicity and more about extensibility, portability, and gravitational pull of the ecosystem.
Code Example
# K8s extensibility: define your own resource kind
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata: { name: backups.ops.example.com }
# ...an operator then reconciles Backup objects like native onesInterview Tip
Don't just list features. The insight is 'Kubernetes won on extensibility (CRDs/operators) and ecosystem/cloud backing, despite being harder than Swarm.' That framing shows strategic understanding.