How percona/percona-postgresql-operator works
Percona Operator for PostgreSQL turns Kubernetes custom resources into managed PostgreSQL clusters and related services. The primary workflow is a user submitting a cluster request, the operator reconciling it, and Kubernetes resources implementing the desired database state. Separate controllers handle backups, restores, upgrades, and supporting integrations. The graph includes both the upstream-style and Percona API controller paths, plus documented high availability, replication, monitoring, and user-management capabilities. Relationships are limited to README statements and SOURCE INDEX references; unsampled wiring is not inferred.
Main entry points: pgcluster/controller.go PerconaPGCluster reconcile · postgrescluster/controller.go PostgresCluster reconcile · main.go Operator process · pgbackup/controller.go Backup controller
Components 20
Operator control plane
- Operator process
cmd/postgres-operator/main.go - Custom resources
pkg/apis/pgv2.percona.com/v2/perconapgcluster_types.go
Cluster lifecycle
- PostgresCluster reconcile
internal/controller/postgrescluster/controller.go - PerconaPGCluster reconcile
percona/controller/pgcluster/controller.go - PostgreSQL configuration
internal/postgres/reconcile.go - HA orchestration
internal/patroni/reconcile.go - Logical replication
internal/logicalreplica/postgres.go
Data operations
- Cluster upgrade
internal/controller/pgupgrade/pgupgrade_controller.go - Percona upgrade
percona/controller/pgupgrade/controller.go - Backup controller
percona/controller/pgbackup/controller.go - Restore controller
percona/controller/pgrestore/controller.go - Backup tooling
internal/pgbackrest/reconcile.go
Cluster integrations
- PGAdmin management
internal/controller/standalone_pgadmin/controller.go - Monitoring exporter
internal/pgmonitor/exporter.go - PMM integration
percona/pmm/pmm.go - Certificate management
percona/certmanager/certmanager.go - Crunchy Bridge integration
internal/bridge/crunchybridgecluster/crunchybridgecluster_controller.go
Other components
- Kubernetes user
- Kubernetes API
- Crunchy Bridge API
Connections 23
- Kubernetes user → Custom resources: submits
- Custom resources → Kubernetes API: stored in
- Operator process → Kubernetes API: watches resources
- Operator process → PostgresCluster reconcile: registers controller
cmd/postgres-operator/main.go - Operator process → PerconaPGCluster reconcile: registers controller
cmd/postgres-operator/main.go - PostgresCluster reconcile → PostgreSQL configuration: uses
internal/controller/postgrescluster/controller.go - PostgresCluster reconcile → HA orchestration: uses
internal/controller/postgrescluster/controller.go - PostgresCluster reconcile → Logical replication: uses
internal/controller/postgrescluster/controller.go - PerconaPGCluster reconcile → PostgreSQL configuration: uses
percona/controller/pgcluster/controller.go - PerconaPGCluster reconcile → Cluster upgrade: watches upgrades
- Percona upgrade → PerconaPGCluster reconcile: updates cluster
percona/controller/pgupgrade/controller.go - Backup controller → PerconaPGCluster reconcile: reads cluster
percona/controller/pgbackup/controller.go - Backup controller → Backup tooling: uses
- Restore controller → PerconaPGCluster reconcile: reads cluster
percona/controller/pgrestore/controller.go - Restore controller → Backup tooling: uses
- PerconaPGCluster reconcile → PGAdmin management: configures alongside
- PerconaPGCluster reconcile → Monitoring exporter: configures alongside
- PerconaPGCluster reconcile → PMM integration: integrates
percona/controller/pgcluster/controller.go - PerconaPGCluster reconcile → Certificate management: uses
percona/certmanager/certmanager.go - Operator process → Crunchy Bridge integration: registers controller
cmd/postgres-operator/main.go - Crunchy Bridge integration → Crunchy Bridge API: creates clusters
internal/bridge/crunchybridgecluster/crunchybridgecluster_controller.go - PostgresCluster reconcile → Kubernetes API: reconciles resources
internal/controller/postgrescluster/controller.go - PerconaPGCluster reconcile → Kubernetes API: reconciles resources
percona/controller/pgcluster/controller.go