DEV.co
Open-Source DevOps · cloudnative-pg

cloudnative-pg

CloudNativePG is an open-source Kubernetes operator that automates PostgreSQL database management within Kubernetes clusters, handling deployment, scaling, failover, and disaster recovery. It integrates directly with the Kubernetes API rather than relying on external HA tools, making PostgreSQL operations cloud-native.

Source: GitHub — github.com/cloudnative-pg/cloudnative-pg
8.9k
GitHub stars
721
Forks
Go
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorycloudnative-pg/cloudnative-pg
Ownercloudnative-pg
Primary languageGo
LicenseApache-2.0 — OSI-approved
Stars8.9k
Forks721
Open issues391
Latest releasev1.30.0 (2026-06-29)
Last updated2026-07-08
Sourcehttps://github.com/cloudnative-pg/cloudnative-pg

What cloudnative-pg is

A Go-based Kubernetes operator that manages PostgreSQL clusters through custom resources (Cluster, Backup, ScheduledBackup, Pooler, etc.), automating failover, rolling updates, streaming replication, and backup orchestration. The operator follows immutable infrastructure patterns and exposes cluster state directly via the Kubernetes API.

Quickstart

Get the cloudnative-pg source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/cloudnative-pg/cloudnative-pg.gitcd cloudnative-pg# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

PostgreSQL on Kubernetes for DevOps-driven organizations

Teams using GitOps CI/CD and Kubernetes-native infrastructure benefit from CloudNativePG's direct API integration and declarative cluster management. No external HA tooling required.

Automated failover and high-availability PostgreSQL

Environments requiring automated primary failover, replica scaling, and self-healing can leverage the operator's built-in orchestration without Patroni, repmgr, or Stolon.

Disaster recovery with managed backups and PITR

Organizations needing point-in-time recovery, scheduled backups, and multi-region failover can use CloudNativePG's Backup and ScheduledBackup resources for automated lifecycle management.

Implementation considerations

  • Requires Kubernetes 1.x environment (version requirement not explicitly stated in excerpt; verify current minimum). Operator must be deployed as a Pod or DaemonSet.
  • PostgreSQL cluster state is defined declaratively via Cluster CRD; changes trigger reconciliation loops. Understand desired vs. actual state patterns before deploying to production.
  • Backup and disaster recovery strategy must be configured upfront via Backup and ScheduledBackup resources; no defaults assumed for retention or recovery targets.
  • Persistent storage provisioning is delegated to Kubernetes storage classes. Ensure adequate PV/PVC capacity and performance tuning aligned with PostgreSQL workload.
  • Rolling updates and switchovers are automated but should be tested in non-production first; understand the operator's rolling strategy and potential downtime windows.

When to avoid it — and what to weigh

  • PostgreSQL forks or non-vanilla PostgreSQL — Project explicitly supports only vanilla PostgreSQL from PGDG. PostgreSQL forks or modified distributions are out of scope unless integrated as extensions.
  • Non-Kubernetes database deployments — CloudNativePG is Kubernetes-only and will not work for on-premise VMs, bare metal, or non-Kubernetes container orchestration platforms.
  • Multi-database management — This is a PostgreSQL-specific operator. If you need to manage multiple database engines (MySQL, MariaDB, MongoDB, etc.), a general-purpose database operator is required.
  • Organizations without Kubernetes expertise — Requires solid Kubernetes operational knowledge. Teams unfamiliar with operators, CRDs, and Kubernetes API patterns will face a steep learning curve.

License & commercial use

Licensed under Apache License 2.0 (Apache-2.0), a permissive OSI-approved license allowing commercial use, modification, and redistribution under the stated terms. No proprietary restrictions.

Apache-2.0 permits commercial use without license fees. Commercial support is offered separately (cloudnative-pg.io/support/). Verify support SLA and terms independently for production deployments. License does not indemnify against PostgreSQL licensing; verify PostgreSQL licensing separately.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityHigh
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

Project maintains OpenSSF Best Practices and Baseline badges and OpenSSF Scorecard, indicating security development practices are in place. Operator runs in-cluster with RBAC permissions; verify least-privilege role bindings. No exploit details available in provided data. Conduct threat modeling for backup storage, TLS for replication, and authentication (Keycloak integration mentioned in KubeCon talks). Secrets management for PostgreSQL credentials delegated to Kubernetes; ensure Secret encryption at rest is configured.

Alternatives to consider

Patroni

Standalone HA toolkit for PostgreSQL that does not require Kubernetes; used by many on-premise deployments. Less Kubernetes-native but more portable across infrastructure.

Percona Distribution for PostgreSQL Operator (PG operator by Percona)

Alternative Kubernetes operator for PostgreSQL with focus on monitoring, backup, and disaster recovery. Requires evaluation of feature parity and Kubernetes integration depth.

Timescale Cloud or AWS RDS for PostgreSQL

Software development agency

Build on cloudnative-pg with DEV.co software developers

Start with the CloudNativePG Quickstart Guide. Assess your Kubernetes expertise, storage setup, and disaster recovery requirements before production deployment.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

cloudnative-pg FAQ

Does CloudNativePG support PostgreSQL version X?
Project supports vanilla PostgreSQL from PGDG. Check ADOPTERS.md and Roadmap for verified versions. Specific version support matrix not provided in excerpt; consult official documentation.
Can I use CloudNativePG with managed Kubernetes (EKS, GKE, AKS)?
Yes. Operator runs on any CNCF-maintained Kubernetes. No cloud-provider-specific features mentioned; standard cluster requirements apply.
What happens to data if a cluster Pod fails?
Operator detects Pod failure and initiates failover logic (if primary) or replica rebuild (if standby). Data durability depends on Persistent Volumes and replication configuration. Review failover documentation for RTO/RPO expectations.
Is commercial support available?
Yes. Commercial support is offered at cloudnative-pg.io/support/. Terms, SLA, and pricing require review on the support page.

Software development & web development with DEV.co

DEV.co helps companies turn open-source tools like cloudnative-pg into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source devops stack.

Ready to run PostgreSQL on Kubernetes?

Start with the CloudNativePG Quickstart Guide. Assess your Kubernetes expertise, storage setup, and disaster recovery requirements before production deployment.