DEV Community

Gaberial Sofie
Gaberial Sofie

Posted on

Running Postgres, Redis and RabbitMQ inside your local k3d cluster (with the 2025 Bitnami trap)

Chapter 9 of a local-Kubernetes series: the stateful-dependencies chapter the earlier ones deliberately deferred. Bring up your backing services in the cluster so local structurally matches prod — and avoid a 2025 supply-chain landmine.

Key takeaways

  • Why in-cluster, not compose-on-the-side: one world, not two. In-cluster Postgres/Redis/RabbitMQ gets you unified DNS/service discovery (app finds the DB at postgres, not localhost:5432), shared Secrets/ConfigMaps, and you catch RBAC/limits/probe problems before rollout. (Fair: compose is a legit choice if the service isn't going to k8s.)
  • The Bitnami warning without which this chapter would be harmful: since 2025-09-29 most public Bitnami OCI charts/images moved behind a Broadcom subscription; the rest are bitnamilegacy (unsupported, no security patches). Don't blindly recommend bitnami/* in 2026. Use Chainguard's drop-in charts, official operators, or a deliberately-pinned legacy tag (dev only).
  • The most predictable dev path is a raw 3-object manifest: Deployment (official postgres:17) + Service (stable DNS postgres) + PVC — no chart repos, no subscription dependency. Includes a pg_isready readiness probe.
  • The big storage surprise: in k3d, data is ephemeral by defaultlocal-path-provisioner writes inside the node container, so k3d cluster delete wipes it. To persist, map a host dir at create: --volume $HOME/k3d-storage:/var/lib/rancher/k3s/storage@all.
  • Wire into Tilt: feed the manifest to k8s_yaml, order startup with resource_deps (myapp waits for postgres's readiness), port_forwards=['5432:5432'] to reach it from your IDE.
  • Migrations: a separate Job (+ initContainer wait), ordered postgres → migrate → seed → myapp. Migrations in the app's own initContainer is an anti-pattern (races across replicas, probe kills). Note Tilt's built-in helm() skips hooks — use helm_resource for anything with init hooks.
  • Mock vs run: OSS deps (Postgres/Redis/RabbitMQ) → run as-is; proprietary managed (S3/SQS/DynamoDB) → emulate with LocalStack, but it's not 1:1 (IAM, consistency, edge cases).

Full article: https://dorokhovich.com/blog/local-k8s-dependencies-databases-queues?utm_source=devto&utm_medium=syndication&utm_campaign=local-k8s-dependencies-databases-queues

Top comments (0)