28/10/2026

Docker Compose vs Kubernetes: Picking Right for a Small Team

We get this question a lot: "Should we move to Kubernetes, or is Docker Compose enough?"

We get this question a lot: "Should we move to Kubernetes, or is Docker Compose enough?"

Short answer: it depends on how many servers you have and how expensive downtime is for you. Plenty of small teams jump to Kubernetes because it's the big name, then spend half their time keeping the cluster alive. Others have grown a lot and are still stuck on one server with Compose.

At ITcorv we've seen both in enterprise projects. This post lays out the difference simply, so you can make the call yourself.

What is Docker Compose?

Docker Compose takes one YAML file (usually compose.yaml) and brings up all your project's containers together: app, database, Redis, whatever.

The key point: it runs on one server. Every container lives on that one machine. If that server goes down, everything goes down.

But it's simple. One file, one command, done.

What is Kubernetes?

Kubernetes (k8s) spreads and manages containers across multiple servers. You tell it "I want 3 copies of this app", and it makes sure there are always 3.

  • A container crashes? It brings it back.
  • A whole node is lost? It moves the pods to other nodes.
  • New version? It swaps them one by one (rolling update) so the service stays up.
  • Load goes up? With HPA it adds pods automatically.

But it has a cost. You maintain the control plane, understand cluster networking (CNI), set up Ingress and storage, and keep the cluster upgraded. A serious cluster with a highly available control plane usually needs 3 control plane nodes.

The main difference at a glance

| | Docker Compose | Kubernetes | |---|---|---| | Servers | One | Many | | A server dies | Everything is down | Pods move to another node | | Zero-downtime updates | Not by default | Yes, rolling updates | | Autoscaling | No | Yes (HPA) | | Learning and upkeep | Simple | Heavy | | Good fit | One server, a few services | Many servers, many services, bigger team |

When Compose is enough

  • Your whole system fits on one server.
  • A few seconds of downtime during deploys is fine.
  • Your team is small and nobody can look after a cluster full time.
  • Your load doesn't swing wildly.

Here, Compose plus solid backups and simple monitoring is usually far better than a half-built Kubernetes.

If you're still building your DevOps skills, our DevOps roadmap shows where Kubernetes fits.

When you need Kubernetes

  • One server isn't enough anymore, or you don't want one dead server to take the whole service down.
  • Downtime during deploys isn't acceptable.
  • You have many services and several teams deploying to the same infrastructure.
  • Load goes up and down and you want automatic scaling.

If you're somewhere in between, look at k3s. It's a lightweight Kubernetes distribution that installs as a single binary and exposes the same Kubernetes APIs. Much less painful to start with.

Sample file: an app with Compose

A simple compose.yaml with an app and PostgreSQL:

yaml@itcorv:~
services:
  db:
    image: postgres:17
    restart: unless-stopped
    environment:
      POSTGRES_USER: app
      POSTGRES_DB: app
      POSTGRES_PASSWORD_FILE: /run/secrets/db_password
    secrets:
      - db_password
    volumes:
      - db_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U app -d app"]
      interval: 10s
      timeout: 5s
      retries: 5

  web:
    image: registry.example.com/app:1.4.2
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
    environment:
      DATABASE_HOST: db
    ports:
      - "127.0.0.1:8080:8080"
    deploy:
      resources:
        limits:
          cpus: "1"
          memory: 512M

secrets:
  db_password:
    file: ./secrets/db_password.txt

volumes:
  db_data:

A few notes:

  • depends_on with service_healthy means the app won't start until the database is actually ready.
  • The port is only bound to 127.0.0.1. Put nginx in front of it (covered in our nginx post).
  • The DB password lives in a separate file, not in the YAML.
  • The image tag is a version, not latest.

The same app on Kubernetes

Move the same app to Kubernetes and the web part looks roughly like this:

yaml@itcorv:~
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
spec:
  replicas: 3
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
        - name: web
          image: registry.example.com/app:1.4.2
          ports:
            - containerPort: 8080
          env:
            - name: DATABASE_HOST
              value: db
          readinessProbe:
            httpGet:
              path: /healthz
              port: 8080
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8080
          resources:
            requests:
              cpu: 250m
              memory: 256Mi
            limits:
              memory: 512Mi
---
apiVersion: v1
kind: Service
metadata:
  name: web
spec:
  selector:
    app: web
  ports:
    - port: 80
      targetPort: 8080

See? For one service the file already got longer, and we haven't written Ingress, the database, Secrets or storage yet. That's the cost we mentioned. In return you get 3 replicas, a pod that isn't ready gets no traffic, and a hung pod restarts itself.

(Your app needs to expose the /healthz endpoint. Use whatever path yours actually has.)

Testing

Compose

bash@itcorv:~
# validate the file; YAML errors show up here
docker compose config

# bring it up
docker compose up -d

# status and health
docker compose ps

# app logs
docker compose logs -f web

In docker compose ps you should see db as healthy. Reboot the server once too. With restart: unless-stopped and the Docker service enabled, the containers come back on their own.

Kubernetes

bash@itcorv:~
kubectl apply -f web.yaml
kubectl rollout status deployment/web
kubectl get pods -l app=web

# delete a pod and watch a new one appear
kubectl delete pod <name-of-one-pod>
kubectl get pods -l app=web -w

That last one is what Compose doesn't give you. Delete a pod and a few seconds later a new one is in its place.

Tips

  • Start with Compose, but write it clean. Versioned image tags, health checks, secrets outside the file, config from env. Then if you move to Kubernetes one day, the migration is easy.
  • Kompose is a tool that converts a Compose file into Kubernetes manifests. Good for a start, but always review the output by hand.
  • Don't rush the database into Kubernetes. Often it's better to run the app in the cluster and keep the database on a separate server or a managed service.
  • Take the registry seriously. Compose or Kubernetes, your nodes have to pull images. If your servers are in Iran, see our Docker Hub in Iran post.
  • Automate deploys. With GitLab CI you can deploy to Compose or to Kubernetes.
  • Don't forget monitoring. Kubernetes without monitoring means you won't know why a pod keeps restarting. We usually set up Prometheus, Grafana and Loki.

FAQ

Is Kubernetes pointless on one server?

Not pointless, but its biggest benefit, moving pods when a node dies, basically doesn't exist on one server. For learning or testing, k3s on one server is fine. For serious production, you need multiple nodes.

What about Docker Swarm?

Swarm is multi-server too and uses Compose-like files. It's simpler than Kubernetes, but its ecosystem and tooling are much smaller. If you pick it, pick it with open eyes.

Can Compose do zero-downtime deploys?

Not by default. docker compose up -d recreates the changed container, so there's a short outage. You can reduce it with tricks like two copies behind nginx, but then you're doing by hand what Kubernetes does for you.

How do I know it's time for Kubernetes?

When one server isn't enough, downtime has become expensive, or manual deploys across several servers are eating your team's time. If none of that is true, you don't need it yet.

---

Not sure which one fits your system? The ITcorv team can review your infrastructure and point you down the right path. Reach us through consulting or DevOps services.