Go to file
Your Name 7d418deea9
spellcheck-woke / Run woke (push) Has been cancelled Details
spellcheck-woke / Run spellcheck (push) Has been cancelled Details
Refresh licenses directory / Refresh licenses (push) Has been cancelled Details
CodeQL / Skip duplicate runs (push) Has been cancelled Details
CodeQL / Analyze (push) Has been cancelled Details
初始提交
2025-09-19 11:54:43 +08:00
.devcontainer 初始提交 2025-09-19 11:54:43 +08:00
.github 初始提交 2025-09-19 11:54:43 +08:00
api/v1 初始提交 2025-09-19 11:54:43 +08:00
cmd 初始提交 2025-09-19 11:54:43 +08:00
config 初始提交 2025-09-19 11:54:43 +08:00
contribute 初始提交 2025-09-19 11:54:43 +08:00
docs 初始提交 2025-09-19 11:54:43 +08:00
hack 初始提交 2025-09-19 11:54:43 +08:00
internal 初始提交 2025-09-19 11:54:43 +08:00
licenses/go-licenses 初始提交 2025-09-19 11:54:43 +08:00
pkg 初始提交 2025-09-19 11:54:43 +08:00
releases 初始提交 2025-09-19 11:54:43 +08:00
tests 初始提交 2025-09-19 11:54:43 +08:00
.dockerignore 初始提交 2025-09-19 11:54:43 +08:00
.gitignore 初始提交 2025-09-19 11:54:43 +08:00
.golangci.yml 初始提交 2025-09-19 11:54:43 +08:00
.goreleaser.yml 初始提交 2025-09-19 11:54:43 +08:00
.snyk 初始提交 2025-09-19 11:54:43 +08:00
.spellcheck.yaml 初始提交 2025-09-19 11:54:43 +08:00
.woke.yaml 初始提交 2025-09-19 11:54:43 +08:00
.wokeignore 初始提交 2025-09-19 11:54:43 +08:00
.wordlist-en-custom.txt 初始提交 2025-09-19 11:54:43 +08:00
ADOPTERS.md 初始提交 2025-09-19 11:54:43 +08:00
CODEOWNERS 初始提交 2025-09-19 11:54:43 +08:00
CODE_OF_CONDUCT.md 初始提交 2025-09-19 11:54:43 +08:00
CONTRIBUTING.md 初始提交 2025-09-19 11:54:43 +08:00
Dockerfile 初始提交 2025-09-19 11:54:43 +08:00
GOVERNANCE.md 初始提交 2025-09-19 11:54:43 +08:00
LICENSE 初始提交 2025-09-19 11:54:43 +08:00
MAINTAINERS.md 初始提交 2025-09-19 11:54:43 +08:00
Makefile 初始提交 2025-09-19 11:54:43 +08:00
PROJECT 初始提交 2025-09-19 11:54:43 +08:00
README.md 初始提交 2025-09-19 11:54:43 +08:00
SECURITY.md 初始提交 2025-09-19 11:54:43 +08:00
SUPPORT.md 初始提交 2025-09-19 11:54:43 +08:00
docker-bake.hcl 初始提交 2025-09-19 11:54:43 +08:00
go.mod 初始提交 2025-09-19 11:54:43 +08:00
go.sum 初始提交 2025-09-19 11:54:43 +08:00

README.md

CNCF Landscape Latest Release GitHub License OpenSSF Best Practices Documentation Stack Overflow FOSSA Status

Welcome to the CloudNativePG Project!

CloudNativePG (CNPG) is an open-source platform designed to seamlessly manage PostgreSQL databases in Kubernetes environments. It covers the entire operational lifecycle—from deployment to ongoing maintenance—through its core component, the CloudNativePG operator.

Table of Contents

Getting Started

The best way to get started is the Quickstart Guide.

Scope

Mission

CloudNativePG aims to increase PostgreSQL adoption within Kubernetes by making it an integral part of the development process and GitOps-driven CI/CD automation.

Core Principles & Features

Designed by PostgreSQL experts for Kubernetes administrators, CloudNativePG follows a Kubernetes-native approach to PostgreSQL primary/standby cluster management. Instead of relying on external high-availability tools (like Patroni, repmgr, or Stolon), it integrates directly with the Kubernetes API to automate database operations that a skilled DBA would perform manually.

Key design decisions include:

  • Direct integration with Kubernetes API: The PostgreSQL clusters status is available directly in the Cluster resource, allowing users to inspect it via the Kubernetes API.
  • Operator pattern: The operator ensures that the desired PostgreSQL state is reconciled automatically, following Kubernetes best practices.
  • Immutable application containers: Updates follow an immutable infrastructure model, as explained in "Why EDB Chose Immutable Application Containers".

How CloudNativePG Works

The operator continuously monitors and updates the PostgreSQL cluster state. Examples of automated actions include:

  • 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.
  • Service updates: Kubernetes remains the single source of truth, ensuring that PostgreSQL service endpoints are always up to date.
  • 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.

CloudNativePG manages additional Kubernetes resources to enhance PostgreSQL management, including: Backup, ClusterImageCatalog, Database, ImageCatalog, Pooler, Publication, ScheduledBackup, and Subscription.

Out of Scope

  • Kubernetes only: CloudNativePG is dedicated to vanilla Kubernetes maintained by the Cloud Native Computing Foundation (CNCF).
  • PostgreSQL only: CloudNativePG is dedicated to vanilla PostgreSQL maintained by the PostgreSQL Global Development Group (PGDG).
  • No support for forks: Features from PostgreSQL forks will only be considered if they can be integrated as extensions or pluggable frameworks.
  • Not a general-purpose database operator: CloudNativePG does not support other databases (e.g., MariaDB).

CloudNativePG can be extended via the CNPG-I plugin interface.

Communications

Resources

Adopters

A list of publicly known users of the CloudNativePG operator is in ADOPTERS.md. Help us grow our community and CloudNativePG by adding yourself and your organization to this list!

CloudNativePG at KubeCon


We are a Cloud Native Computing Foundation Sandbox project.

CNCF logo


CloudNativePG was originally built and sponsored by EDB.

EDB logo


Postgres, PostgreSQL, and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada, and used with their permission.