Configs2026年9月12日·1 分钟阅读

Crunchy PGO — Production PostgreSQL Operator for Kubernetes

An open-source Kubernetes operator by Crunchy Data that automates deploying, managing, and scaling PostgreSQL clusters with built-in high availability and backups.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Crunchy PGO
直接安装命令
npx -y tokrepo@latest install d80cce10-aeaa-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Crunchy PGO (Postgres Operator) is a Kubernetes operator that manages the full lifecycle of PostgreSQL clusters. It handles provisioning, high availability with automatic failover, backups via pgBackRest, and day-two operations like scaling and minor version upgrades, all declared through Kubernetes custom resources.

What Crunchy PGO Does

  • Deploys PostgreSQL clusters on Kubernetes with a single custom resource definition
  • Manages high availability using Patroni-based leader election and automatic failover
  • Automates full, incremental, and differential backups with pgBackRest
  • Handles connection pooling through integrated PgBouncer sidecar containers
  • Supports cloning, point-in-time recovery, and standby cluster creation

Architecture Overview

PGO runs as a controller in the Kubernetes control plane. It watches PostgresCluster custom resources and reconciles the desired state by creating StatefulSets, Services, ConfigMaps, and Secrets. Each PostgreSQL instance runs in its own pod with Patroni managing replication and failover. pgBackRest runs as a dedicated repository host pod, storing backups on PVCs or S3-compatible object storage. PgBouncer pods provide connection pooling between applications and the database.

Self-Hosting & Configuration

  • Install the operator using Kustomize or Helm into any Kubernetes cluster
  • Define clusters declaratively via the PostgresCluster CRD in YAML
  • Configure backup schedules and retention policies in the pgbackrest section of the spec
  • Scale replicas by updating the instances.replicas field and applying the manifest
  • Store backups on local PVCs, AWS S3, Google Cloud Storage, or Azure Blob Storage

Key Features

  • Automated failover with zero-downtime leader election via Patroni
  • Built-in pgBackRest integration for continuous archiving and point-in-time recovery
  • PgBouncer connection pooling managed as part of the cluster lifecycle
  • TLS encryption for client connections and inter-node replication
  • Monitoring integration with Prometheus via the crunchy-postgres-exporter sidecar

Comparison with Similar Tools

  • CloudNativePG — similar Kubernetes-native operator; PGO has longer history and Crunchy Data commercial backing
  • Zalando Postgres Operator — uses Patroni like PGO but with a different CRD design and Spilo images
  • KubeDB — supports multiple databases; PGO is PostgreSQL-focused with deeper Postgres integration
  • Pigsty — Ansible-based for VMs; PGO is purpose-built for Kubernetes environments
  • Amazon RDS — managed service; PGO gives full control on your own Kubernetes infrastructure

FAQ

Q: Does PGO support major PostgreSQL version upgrades? A: PGO supports minor version upgrades through rolling updates. Major version upgrades require creating a new cluster and migrating data using pg_dump/pg_restore or logical replication.

Q: Can I use PGO with an existing PostgreSQL database? A: PGO provisions new clusters. To adopt an existing database, you would restore a pgBackRest backup or pg_dump into a PGO-managed cluster.

Q: How does automatic failover work? A: Patroni monitors the primary and replicas. If the primary becomes unreachable, Patroni promotes a replica and PGO updates the Kubernetes Service endpoints so applications reconnect automatically.

Q: Is PGO free to use? A: Yes. PGO is open source under the Apache 2.0 license. Crunchy Data offers commercial support and a certified distribution for enterprise customers.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产