postgres-operator/pkg
Alec Thomas 513291c58d Create critical-op PDB on-demand to avoid false monitoring alerts
The critical-op PodDisruptionBudget was previously created permanently,
but its selector (critical-operation=true) matched no pods during normal
operation. This caused false alerts in monitoring systems like
kube-prometheus-stack because the PDB expected healthy pods but none
matched.

Changes:
- Modified syncCriticalOpPodDisruptionBudget to check if any pods have
  the critical-operation label before creating/keeping the PDB
- PDB is now created on-demand when pods are labeled (e.g., during
  major version upgrades) and deleted when labels are removed
- Updated majorVersionUpgrade to explicitly create/delete the PDB
  around the critical operation for immediate protection
- Removed automatic critical-op PDB creation from initial cluster setup
- Added test to verify on-demand PDB creation and deletion behavior,
  including edge cases for idempotent create/delete operations

The explicit PDB creation in majorVersionUpgrade ensures immediate
protection before the critical operation starts. The sync function
serves as a safety net for edge cases like bootstrap (where Patroni
applies labels) or operator restarts during critical operations.

Fixes #3020
2026-01-02 16:05:32 -05:00
..
apis fix docker build for UI and bumped some outdated versions in docs and config (#3017) 2025-12-18 12:12:53 +01:00
apiserver Add operator deployment readiness probe (#1874) 2023-01-05 18:29:47 +01:00
cluster Create critical-op PDB on-demand to avoid false monitoring alerts 2026-01-02 16:05:32 -05:00
controller bump to v1.15.1 (#3011) 2025-12-16 19:25:12 +01:00
generated update codegen (#2832) 2025-01-03 16:18:17 +01:00
spec skip db user actions when its secret failed to sync on update (#2969) 2025-11-05 16:28:37 +01:00
teams improve additional teams lookup (#2445) 2023-10-16 16:48:19 +02:00
util bump to v1.15.1 (#3011) 2025-12-16 19:25:12 +01:00