Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Docker & containersIT series

Docker Compose vs Kubernetes

Docker Compose and Kubernetes both run multi-container apps from a file, so teams ask which to use. They are built for very different scales, and starting with the wrong one wastes a lot of time.

Quick reference

COMPOSEKUBERNETES
ScopeOne machineA cluster of nodes
Self-healingRestart onlyReschedules, scales
ScalingManualAutomatic (HPA)
Load balancingBasicBuilt in
Learning curveAn afternoonWeeks
Best forDev, small appsProduction at scale

COMPOSE (One host): Runs a set of containers on a single machine from one file.

docker compose up

KUBERNETES (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

Open in the notes app: search, filters, copy This note on GitHub