CloudNativePG is an open-source Kubernetes operator written in Go that manages PostgreSQL databases within Kubernetes environments across their complete operational lifecycle. The project addresses the challenge of running PostgreSQL in Kubernetes by replacing external high-availability tools like Patroni, repmgr, and Stolon with direct integration into the Kubernetes API, allowing PostgreSQL cluster state to be inspected and managed through native Kubernetes resources.
The operator automates critical database operations that would traditionally require manual intervention from skilled database administrators. When a primary PostgreSQL instance fails, CloudNativePG automatically elects a new primary and orchestrates the transition while updating cluster status. The operator handles scaling of read replicas by provisioning or removing Kubernetes resources such as persistent volumes, secrets, and config maps while managing streaming replication. Rolling updates follow an immutable infrastructure model, updating replica pods before performing a controlled switchover for the primary instance. The operator continuously monitors the PostgreSQL cluster and reconciles its actual state with the desired state, following Kubernetes best practices through the operator pattern.
Beyond core cluster management, CloudNativePG manages additional Kubernetes resources including Backup, ClusterImageCatalog, Database, ImageCatalog, Pooler, Publication, ScheduledBackup, and Subscription resources. The project maintains strict scope boundaries, dedicating itself exclusively to vanilla Kubernetes maintained by the Cloud Native Computing Foundation and vanilla PostgreSQL maintained by the PostgreSQL Global Development Group. It does not support PostgreSQL forks unless they can be integrated as extensions, and it is not a general-purpose database operator supporting other databases like MariaDB. The project can be extended through the CNPG-I plugin interface.
The repository demonstrates active community engagement with a median issue and pull request response latency of 0.0 hours and a mean latency of 41.7 hours across 2135 tracked items. The most active contributors include gbartolini with 2658 events, mnencia with 2174 events, and sxd with 1008 events. The project maintains robust triage processes with 912 triage-labeled items, 532 stale items, and 380 backport failure items tracked as the most active issue labels. The project has established connections with other cloud-native projects including github/gh-aw, solo-io/gloo, and longhorn/longhorn through overlapping contributors.
CloudNativePG's mission centers on increasing PostgreSQL adoption within Kubernetes by making it an integral part of development processes and GitOps-driven CI/CD automation. The project has gained visibility at major industry conferences including multiple presentations at KubeCon Europe and KubeCon North America, covering topics ranging from disaster recovery with large PostgreSQL databases to data sovereignty and modern authorization patterns. The project maintains public documentation including a quickstart guide, roadmap, FAQ, and an adopters list, with commercial support available through its official website at cloudnative-pg.io.