Back to Blog
Kubernetes
PostgreSQL
Running postgresql in Kubernetes
February 11, 2026
4 min read read
# Running postgresql in Kubernetes
## What started the discussion
Is it true that stateful programs are better run on a separate machine than in Kubernetes? For example, Postgres, Kafka, and so on.
## What stood out in the comments
### Discussion point 1
StatefulSets exist, also CloudnativePG but you probably should use RDS if you need to ask this.
### Discussion point 2
Not really, check out cloudnative pg if u wanna run a production grade DB.
### Discussion point 3
In the early days of Kubernetes people used to say it was no good for stateful workloads but that’s no longer true. The best way of running Postgres on Kubernetes is to use CloudNative Postgres operator (CNPG). It takes most of the complexity away.
### Discussion point 4
Statefulness is hard, but it's hard with or without kubernetes.
### Discussion point 5
You can absolutely run these things in a k8s cluster. You just need keep in mind that the data lives on persistent volumes - you shouldn't be relying on container's file systems directly. k8s provides e.g. statefulset specificcally to help with this sort of thing. That said - if you're using one of the big cloud providers anyhow, then using their managed database instances makes a lot of sense - you get a whole load of useful stuff out the box that you'd have to sort out yourself if you're doing your own "deploy a database server with k8s" thing.
## Thread snapshot
- Original subreddit: r/kubernetes
- Original author: u/Minimum-Ad7352
- Reddit score: 69
- Comment count: 75
- Original thread: https://www.reddit.com/r/kubernetes/comments/1roy0zp/running_postgresql_in_kubernetes/
Keep Exploring
Kubernetes’ Quiet Security Revolution Is Here—and It Might Break Everything Before It Fixes Anything
“Kubernetes’ Quiet Security Revolution Is Here—and It Might Break Everything Before It Fixes
Kubernetes Wants You to Move On From Ingress, Yet Gateway API Feels Like a Puzzle Nobody Asked For
“Kubernetes Wants You to Move On From Ingress, Yet Gateway API Feels Like a Puzzle Nobody Asked
Six Years of Silence Explodes Into One Feature That Could Quietly Rewrite Kubernetes Security Forever
“Six Years of Silence Explodes Into One Feature That Could Quietly Rewrite Kubernetes Security
CVE-2026-22039: How an admission controller vulnerability turned Kubernetes namespaces into a security illusion
Just saw this nasty Kyverno CVE that's a perfect example of why I'm skeptical of admission controllers with god-mode RBAC.