Docker & Kubernetes

Do You Even Need Kubernetes? When Docker Compose Is Enough

Home Blog Docker & Kubernetes

Docker & Kubernetes

"We should move to Kubernetes" is one of the most common things we hear from growing teams. Sometimes it is the right call. Just as often, it adds weeks of work and a monthly bill without solving a real problem. This post is the checklist we walk clients through before recommending either option.

What Docker Compose does well

Docker Compose describes a set of containers (your web app, a database, a cache, a worker) in one YAML file and runs them together on a single machine. For a large share of business applications, that is all you need:

  • Simple to reason about. One file, one host, one docker compose up -d.
  • Cheap. A single well-sized VM can comfortably serve thousands of daily users for a typical Django or FastAPI app.
  • Fast to onboard. Any developer who knows Docker can read and change it in an afternoon.
  • Same setup in development and production. Fewer "works on my machine" surprises.

What Kubernetes adds

Kubernetes schedules containers across a cluster of machines and continuously works to keep the running state equal to the desired state. In practice that buys you:

  • Self-healing. Crashed containers are restarted and failed nodes are replaced automatically.
  • Horizontal scaling. Add replicas manually or automatically based on CPU, memory or custom metrics.
  • Zero-downtime rolling deploys with health checks and easy rollback.
  • A standard platform for many services and many teams, with namespaces, RBAC and quotas.

The cost is real: a control plane to run or pay for, YAML (or Helm charts) to maintain, networking and storage concepts to learn, and monitoring that someone has to own.

The checklist

You probably don't need Kubernetes yet if most of these are true:

  • You run one main application plus a database and maybe a background worker.
  • Traffic is predictable and a single server's CPU rarely goes above 50–60%.
  • A few minutes of downtime during a planned deploy is acceptable.
  • You have no dedicated DevOps person.

Kubernetes starts to pay off when several of these are true:

  • You run many services (five or more) that deploy independently.
  • You need high availability: the app must survive a server failing.
  • Load is spiky and you want to scale out automatically.
  • Several teams share infrastructure and need isolation and access control.
  • A client or regulator requires a standard, auditable deployment platform. This is common in government projects.

A middle path that works well

Many of our projects start on Compose and are built so the move to Kubernetes later is painless:

  1. Keep config in environment variables, never baked into images.
  2. Make containers stateless. Uploads go to object storage and sessions go to Redis or the database.
  3. Add health-check endpoints (/healthz) from day one.
  4. Use a managed database so the hardest stateful piece is already off your servers.
  5. Tag images by version (app:1.4.2, not just latest) and push them to a registry.

Do these five things and moving to Kubernetes later is mostly a matter of writing Deployment and Service manifests, not re-architecting the app.

A simple production Compose file

services:
  web:
    image: registry.example.com/app:1.4.2
    env_file: .env
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/healthz"]
      interval: 30s
  worker:
    image: registry.example.com/app:1.4.2
    command: celery -A app worker -l info
    env_file: .env
    restart: unless-stopped
  redis:
    image: redis:7-alpine
    restart: unless-stopped

Bottom line

Choose the simplest platform that meets your reliability requirements today, and build the app so it can grow. Kubernetes is a great tool when you have the problems it solves. It is an expensive hobby when you don't.

Not sure which side of the line you are on? Our Cloud & DevOps team can review your setup and give you a straight answer.