cloudnative-pg

The most popular Kubernetes Operator for PostgreSQL.

What is cloudnative-pg?

The most popular Kubernetes Operator for PostgreSQL.

Overview of cloudnative-pg

What it is

CloudNativePG (CNPG) is an open-source platform designed to manage PostgreSQL databases in Kubernetes environments. It covers the entire operational lifecycle from deployment to ongoing maintenance through its core component, the CloudNativePG operator. It is a Cloud Native Computing Foundation (CNCF) Sandbox project, originally built and sponsored by EDB.

Key features

  • Direct integration with the Kubernetes API: PostgreSQL cluster status is available directly in the Cluster resource, allowing inspection via the Kubernetes API.
  • Operator pattern: The operator automatically reconciles the desired PostgreSQL state following Kubernetes best practices.
  • Immutable application containers: Updates follow an immutable infrastructure model.
  • Automated failover management: If the primary instance fails, the operator elects a new primary, updates the cluster status, and orchestrates the transition.
  • Scaling read replicas: When the number of desired replicas changes, the operator provisions or removes resources such as persistent volumes, secrets, and config maps while managing streaming replication.
  • Rolling updates: When an image is updated, the operator follows a rolling strategy—first updating replica pods before performing a controlled switchover for the primary.
  • Manages additional Kubernetes resources: Backup, ClusterImageCatalog, Database, ImageCatalog, Pooler, Publication, ScheduledBackup, and Subscription.

Use cases

  • Running PostgreSQL in Kubernetes with a Kubernetes-native approach to primary/standby cluster management.
  • Automating database operations that a skilled DBA would perform manually, such as failover, scaling, and rolling updates.
  • Integrating PostgreSQL into GitOps-driven CI/CD automation and development processes.
  • Managing PostgreSQL clusters without relying on external high-availability tools like Patroni, repmgr, or Stolon.

Getting started

See the repository README for installation instructions.

License and pricing

License: Apache-2.0. Pricing: open source (free).

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/cloudnative-pgcloudnative-pg.svg)](https://yunodb.com/tools/cloudnative-pgcloudnative-pg?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/cloudnative-pgcloudnative-pg?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/cloudnative-pgcloudnative-pg.svg" alt="Featured on YunoDB" height="20"></a>