Deploying MongoDB on Kubernetes with Helm

January 26, 2026 2 min read

I wanted to learn Helm and understand how stateful apps work in Kubernetes. So I deployed MongoDB on a local Kind cluster using a custom Helm chart.

What I Did

Built a Helm chart with StatefulSet, PVC, Secrets, and Service. StatefulSet keeps pod identity stable. PVC makes sure data survives restarts. Secrets store the credentials. Service handles internal DNS.

Wrote a small Python script to test the connection. Insert data, query it back, done.

What I Picked Up

  • StatefulSets give pods stable names. Deployments do not.
  • PVC naming matters for data persistence across reinstalls.
  • Helm templating makes deployments repeatable. One command and everything is up.

Still exploring.


📦 Repository

https://github.com/Rahat-Kabir/helm-mongodb-k8s

→ Open Repository