Quick reference
| COMPOSE | KUBERNETES | |
|---|---|---|
| Scope | One machine | A cluster of nodes |
| Self-healing | Restart only | Reschedules, scales |
| Scaling | Manual | Automatic (HPA) |
| Load balancing | Basic | Built in |
| Learning curve | An afternoon | Weeks |
| Best for | Dev, small apps | Production at scale |
COMPOSE (One host): Runs a set of containers on a single machine from one file.
docker compose upKUBERNETES (A cluster): Runs containers across many machines, and keeps them running.
kubectl apply -f .- Compose → dev and single-host apps. Start here.
- Kubernetes → many machines, scale and self-healing.
Explained
Docker Compose describes a set of containers in one YAML file and runs them on a single machine. docker compose up starts the whole stack: app, database, cache, all wired together on one host. It is simple enough to learn in an afternoon, and perfect for local development and small single-server apps.
Kubernetes runs containers across a cluster of machines and, crucially, keeps them running. If a container crashes it restarts it; if a node dies it reschedules the work elsewhere; under load it can add more copies automatically. That power comes with real complexity: pods, services, deployments, ingress and more.
The honest comparison
Compose restarts a failed container. Kubernetes reschedules it onto a healthy node and can scale it with demand. Compose load-balances crudely. Kubernetes has services and ingress built for it. Compose takes an afternoon to learn. Kubernetes takes weeks, plus ongoing operations.
The trap to avoid: reaching for Kubernetes because it is what big companies use. For a single app on one or two servers, Compose or a managed platform is faster to run and far cheaper to operate. Kubernetes earns its complexity when you genuinely need many services, many machines, automatic scaling and self-healing.
A common path is Compose in development and a managed Kubernetes service in production, sharing similar container definitions.
Compose to start. Kubernetes when you outgrow one machine.
More notes: Docker & containers
- P277The Docker command cheat sheet
- P1995 Dockerfile mistakes to avoid
- P196Alpine vs Debian base images
- P1949 docker commands for building and shipping images
- P1649 docker compose commands for daily work
- P163Anatomy of a container image reference
- P147Quiz: 3 container questions
- P133Anatomy of a docker run command
Open in the notes app: search, filters, copy This note on GitHub