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
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.
YubiHSM 2 + cert-manager. Hardware-signed TLS certificates on Kubernetes
I built a cert-manager external issuer that signs TLS certificates using a private key inside a YubiHSM 2.
New policy: Sharing new Kubernetes tools must be in the weekly thread
Hi all.
The Anatomy of Modern Kubernetes Data Protection: Securing KubeVirt Workloads at Enterprise Scale in 2026