docker-compose is not a production stand-in — and here's the receipt
Chapter 2 of a local-Kubernetes series. The thesis is opinionated on purpose: a production-like local environment is not one where everything is like prod — it's one where you know exactly what matches, what doesn't, and why.
Key takeaways
- "Production-like" ≠ "a copy of prod." You can't fit prod on a laptop and you don't need to. The goal is deliberately narrowing the dev/prod gap so packaging and deployment bugs get caught on your machine.
- The gap has a name. Twelve-Factor's tenth factor (Dev/prod parity) calls out three gaps — time, personnel, and tools. It's the tools gap that makes "worked in dev, failed in prod."
- Parity comes down to three things: the same Kubernetes minor version, the same backing services by type and version (Postgres, not SQLite), and the same real manifests you deploy with in prod.
-
Version-pinning gotcha: Docker tags can't contain
+, so you pin k3s asrancher/k3s:v1.31.5-k3s1, notv1.30.2+k3s1. With kind, pin the node image bysha256digest from the release notes. - Reproduce on purpose: K8s version, backing services, requests/limits, liveness/readiness/startup probes, ConfigMap/Secret, Ingress + service discovery.
- Simplify on purpose: scale/topology, managed cloud services (run the OSS equivalent), load testing.
-
Why compose can't validate your manifests: per Kompose's own docs,
depends_onis ignored,build:doesn't build an image, bind mounts aren't preserved, and the output has no requests/limits, no probes, and env vars in plaintext instead of Secrets. "99% of the way there" is still a draft, not a prod manifest.
Ends with a shareable "how production-like is my local setup" checklist.
Top comments (0)