Back to feed
Dev.to
Dev.to
6/16/2026
CloudNativePG: Running PostgreSQL in Kubernetes Without the Pain

CloudNativePG: Running PostgreSQL in Kubernetes Without the Pain

Short summary

CloudNativePG is a production-grade Kubernetes operator for PostgreSQL, but hardened clusters with admission controllers (Kyverno, OPA Gatekeeper) often hang silently during bootstrap. The root cause is invisible: the initdb Job fails policy validation, but errors appear on Job/Pod events, not the Cluster resource. Solution: exclude CNPG-managed resources using the cnpg.io/cluster label selector in your admission policies, and verify RBAC grants necessary permissions.

  • CNPG bootstrap failures are silent: check Job and Pod events, not the Cluster resource
  • Root cause is usually admission controller blocking the bootstrap Pod, not database misconfiguration
  • Solution: exclude CNPG-managed resources (cnpg.io/cluster label) from restrictive admission policies

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Explore more