Commit Graph

1524 Commits

Author SHA1 Message Date
Felix Kunde 9b0f4697bb remove wrong commit 2026-07-23 17:33:07 +02:00
Felix Kunde dc15be12e3 fix space issues for e2e test 2026-07-23 17:29:37 +02:00
Felix Kunde 3e9c10d37a update issue template, too 2026-07-23 16:29:05 +02:00
Felix Kunde 86d3027e0d
update docker build commands in Makefiles to use buildx (#3137)
* switch to docker buildx and update docs
* minor update to e2e Dockerfile
2026-07-23 16:24:23 +02:00
annielzy ca9513c831
Add envFrom support to Postgresql spec (#3118)
* add envFrom support
* generate files

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-07-22 17:21:31 +02:00
Tiago Condeixa 1b460310a2
add env var for spilo with irsa (#3135) 2026-07-22 16:40:06 +02:00
dependabot[bot] 46f4315bf1
Bump js-yaml from 4.2.0 to 4.3.0 in /ui/app (#3133)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.2.0 to 4.3.0.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.2.0...4.3.0)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.3.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-21 10:48:51 +02:00
dependabot[bot] ef2efe3aad
Bump requests from 2.32.4 to 2.33.0 in /ui (#3060)
Bumps [requests](https://github.com/psf/requests) from 2.32.4 to 2.33.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.32.4...v2.33.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.33.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-07-21 09:38:27 +02:00
dependabot[bot] 8ab2b9b3d8
Bump golang.org/x/crypto from 0.51.0 to 0.52.0 (#3127)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.51.0 to 0.52.0.
- [Commits](https://github.com/golang/crypto/compare/v0.51.0...v0.52.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.52.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-21 09:38:14 +02:00
dependabot[bot] 9e63ca2dfd
Bump flask from 3.0.3 to 3.1.3 in /ui (#3048)
Bumps [flask](https://github.com/pallets/flask) from 3.0.3 to 3.1.3.
- [Release notes](https://github.com/pallets/flask/releases)
- [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/flask/compare/3.0.3...3.1.3)

---
updated-dependencies:
- dependency-name: flask
  dependency-version: 3.1.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-21 08:53:18 +02:00
Tiago Condeixa f2741ef741
we need to add update permission for sa to periodically sync (#3131) 2026-07-17 15:36:00 +02:00
Pierre Ozoux 118c1146bf
docs: correct kubectl commands (#3129)
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
Co-authored-by: Ida Novindasari <idanovinda@gmail.com>
2026-07-17 11:57:30 +02:00
annielzy 5c6dcc65e2
Preserve sync quorum in primary PDB without master selector (#3119)
* Use minAvalable=SynchronousNodeCount + 1 in primary PDB when master selector is disabled

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
Co-authored-by: Ida Novindasari <idanovinda@gmail.com>
2026-07-17 11:56:48 +02:00
Tiago Condeixa 7578f9d2c0
feat (operator): add support for IRSA (aws resources access) (#3128)
* fix data to POSIX and sed working on macos
* add ServiceAccountGetter to the newFakeK8sAnnotationsClient for unit tests
* try to update the service account
* use irsa_role_arn since we need the full arn, and remove enable_irsa
* move sa sync code to existing sync.go file to be all together
* change all Irsa to IRSA to follow go idiomatic that capitalize initialisms or acronyms
* using Update instead of Patch for the service account syn
* document the new option and add the key in the values/configs
* add the new option to the administrator docs
* trying to increase the timeout for the flaky test after sync

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-07-15 18:19:10 +02:00
Tiago Condeixa 85d7aebab2
adjust makefile and scripts to also run on macos (#3130) 2026-07-15 11:24:20 +02:00
Felix Kunde 18e359b995
drop deprecated fields from Postgresql CRD (#3106)
* remove deprecated fields from postgresql CRD

---------

Co-authored-by: ida-novindasari_zse <ida.novindasari@zalando.de>
Co-authored-by: Mikkel Oscar Lyderik Larsen <mikkeloscar@users.noreply.github.com>
Co-authored-by: idanovinda <idanovinda@gmail.com>
2026-07-02 16:53:03 +02:00
Felix Kunde a3d17c12d2
document changed configmap default (#3116)
* document changed configmap default
* update config reference
* add warning message in sync
* address review comments
2026-07-02 14:04:57 +02:00
Felix Kunde 1227fc2e1c
switch to metav1.Duration for timeout options (#3121)
* switch to metav1.Duration for timeout options
* fix custom config parsing and use safe coalesce
2026-06-29 10:32:24 +02:00
Felix Kunde 9030520e24
fix array validation for global maintenance window and protected role names (#3120)
* change type of maintenance windows in config crd
* fix default array type for protected role names
2026-06-26 17:02:50 +02:00
Felix Kunde 26af5a7900
update docs about CRD generation and copy paste to chart dir, too (#3117) 2026-06-26 10:43:57 +02:00
Pierre Ozoux 49895a2200
fix(helm): remove cpu limit (#2893)
There is never a good case for cpu limits :)

https://home.robusta.dev/blog/stop-using-cpu-limits

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-06-26 10:03:56 +02:00
dependabot[bot] db0f112de6
Bump js-yaml from 4.1.1 to 4.2.0 in /ui/app (#3114)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.1 to 4.2.0.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.1...4.2.0)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.2.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-25 09:34:25 +02:00
Felix Kunde df3224730f
Update to Go 1.26.4, build runners and go.mod depedencies (#3108)
* update golang and dependencies
* fix incorrect log formatting
* clean mod chache and introduce GOARCH in Dockerfile (choose dynamically)
* remove GO111MODULE mentions
* bump github actions from v2 to v3
* bump docker runners to v7
* use extra event store for backwards compatibility with existing codebase
* updated generated opconfig api
2026-06-23 13:35:53 +02:00
Felix Kunde a664816c09
auto-generate configuration CRD (#3102)
* auto-generate configuration CRD
* make all subconfig optional
* remove field enable crd validation
* update field descriptions which use proxy types
2026-06-22 10:44:46 +02:00
Jociele Padilha e4e686588e
Fix/logical backup job cleanup (#3111)
* feat(logical-backup): add configurable job history limits and TTL

Adds three new configuration options for logical backup cronjobs:
- logical_backup_successful_jobs_history_limit (default: 3)
- logical_backup_failed_jobs_history_limit (default: 3)
- logical_backup_ttl_seconds_after_finished (default: 86400)

These options control how many completed/failed backup jobs are
retained by Kubernetes and when finished jobs are automatically
deleted. This prevents accumulation of old backup jobs and pods
in namespaces with many PostgreSQL clusters.

Also updates the CronJob comparison logic to detect changes in
these new fields and trigger reconciliation when needed.

Closes zalando/postgres-operator#1092

* add added the 3 new fieldson crd

* updated gen api

---------

Co-authored-by: Jairo Llopis <jairo@moduon.team>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-06-19 12:12:58 +02:00
Felix Kunde 49cde600b8
update new source ranges validation for kubebuilder (#3110) 2026-06-13 00:14:53 +02:00
Felix Kunde a30e15e472
re-generate CRDs to latest state (#3109) 2026-06-12 15:44:55 +02:00
Raphael Torquato 1036350eb4
feat: add IPv6 support to allowedSourceRanges (#3082)
* feat: add IPv6 support to allowedSourceRanges

Update regex pattern in CRD validation to accept both IPv4 and IPv6
CIDR notation, enabling dual-stack networking support.

Fixes #2787

Signed-off-by: Raphael Torquato <>

* add unit test fror ipv6 allowedSourceRanges

---------

Signed-off-by: Raphael Torquato <>
Co-authored-by: Raphael Torquato <>
Co-authored-by: Jociele Padilha <jocielepadilha@gmail.com>
2026-06-12 15:09:06 +02:00
Felix Kunde ebf48667f1
drop kubectl-pg plugin (#3107)
Co-authored-by: Ida Novindasari <idanovinda@gmail.com>
2026-06-12 10:42:37 +02:00
Lucas Nikola Pape a71e6bdf7f
feat: implement service type NodePort (#2986)
feat: implement service type NodePort
fix: handle LoadBalancer to NodePort service type transition
move NodePort check before LoadBalancer and remove redundant nodePor
add LB-specific DNS annotations again
2026-06-12 10:02:26 +02:00
Allen Conlon ab740cf5e5
feat: add publish of helm chart to ghcr.io (#2853)
Signed-off-by: Allen Conlon <software@conlon.dev>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-06-11 09:55:31 +02:00
Raphael Torquato 873dd548ff
Add cluster_labels and annotations to logical backup CronJob and Jobs (#3085)
* Add cluster_labels and annotations to logical backup CronJob and Jobs

When using the logical backup feature, the CronJob and its created Jobs
were missing the cluster_labels and annotations that are applied to
other cluster resources. This made it difficult to filter or identify
backup jobs using the same labels as other cluster components.

Changes:
- Added ObjectMeta with labels and annotations to JobTemplateSpec
- Updated CronJob ObjectMeta to use the merged labels (including
  'application: spilo-logical-backup')
- Updated tests to expect the new labels
2026-06-10 18:18:54 +02:00
Jorge Solorzano f0b5d3725c
Bump github.com/lib/pq from v1.11.2 to v1.12.3 (#3042)
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-06-10 11:32:13 +02:00
Kadaffy Talavera 40b6c68443
fix: set password encryption default to scram-sha-256 (#2962)
* fix: set password encryption default to scram-sha-256

According to the Postgres official documentation, md5 passwords is
deprecated in favor of scram-sha-256 encryption.

The change in this PR updates the default encryption to the new postgres
default.

Documentation link:  https://www.postgresql.org/docs/18/auth-password.html

>Warning: Support for MD5-encrypted passwords is deprecated and will be removed in a future release of PostgreSQL.

Signed-off-by: Kadaffy Talavera <kadtalavera@gmail.com>

* fix: update user documentation about password encryption

Signed-off-by: Kadaffy Talavera <kadtalavera@gmail.com>

* Apply suggestion from @FxKu

---------

Signed-off-by: Kadaffy Talavera <kadtalavera@gmail.com>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-06-04 20:55:04 +02:00
Raphael Torquato a1bbfd9d9a
Fix bool config defaults when using OperatorConfiguration CRD (#3084)
* Fix bool config defaults when using OperatorConfiguration CRD

When using OperatorConfiguration CRD, boolean fields with default value
of `true` (like `enable_database_access` and `debug_logging`) were
incorrectly defaulting to `false` when not explicitly specified.

This happened because Go initializes bool fields to `false`, and there
was no coalesce logic to apply the intended defaults.

The fix changes the CRD type fields from `bool` to `*bool` (pointer),
allowing us to distinguish between "not specified" (nil) and "explicitly
set to false". Then we use the existing `CoalesceBool` utility function
to apply the correct defaults.

Fixes #2575

* update generated code

Updated DeepCopyInto method for OperatorDebugConfiguration to handle pointers for DebugLogging and EnableDBAccess.

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-06-03 13:00:51 +02:00
Zakaria Amine bd2500da81
refactor(controller): use kubernetes informers provided by client-go (#3080)
* refactor(controller): use kubernetes informers provided by client-go
* forgot assigning struct field member

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-06-03 12:43:34 +02:00
Felix Kunde 4177fa27be
Provide liveness probe for CRD and config (#3089)
* add LivenessProbe to both CRDs 
* auto-generate liveness probe for CRD
* update topolgySpreadConstraint schema validation
* Disable it for config map
2026-06-02 17:31:42 +02:00
Raphael Torquato 26165be2d5
test: add unit tests for validate() and NewFromMap() functions (#3086)
This addresses issue #416 by adding comprehensive unit tests for the
config utility functions:

- TestValidate: Tests validation logic for MinInstances/MaxInstances,
  Workers count, ConnectionPooler instances, and user conflicts
- TestNewFromMap: Tests config creation from map with defaults,
  custom values, duration/boolean/map/slice parsing, and panic behavior
- TestMain: Sets OPERATOR_NAMESPACE env var for testing outside K8s

The tests cover both valid configurations and error cases.

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-06-02 10:45:44 +02:00
Kirill Petrov 5fb654f5f7
Add support for passing extra command-line args via Helm values (#2892)
* Add support for passing extra command-line args to the operator via Helm values

This change introduces the ability to specify additional command-line arguments for the Postgres Operator via the "extraArgs" field in values.yaml. Documentation has been updated with details on new arguments "-kubeqps" and "-kubeburst" added before: https://github.com/zalando/postgres-operator/pull/2667. The chart version is bumped to 1.14.1 to reflect these changes.

* reverted charts/postgres-operator/Chart.yaml

---------

Co-authored-by: k.s.petrov <k.s.petrov@2gis.ru>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-06-01 10:04:48 +02:00
thoro f988e4cf0e
Fix deletion timestamp handling for clusters with finalizers (#3015)
When a Postgres cluster has a finalizer, deleting it sets a DeletionTimestamp
but doesn't remove the object until the finalizer is cleared. The operator
was not properly handling these DeletionTimestamp changes:

1. postgresqlUpdate() was filtering out events where only DeletionTimestamp
   changed (it only checked Spec and Annotations), causing the delete to
   never be processed.

2. EventUpdate case in processEvent() didn't check for DeletionTimestamp,
   so even if the event reached the processor, it would run Update() instead
   of Delete().

3. removeFinalizer() used a cached object with stale resourceVersion,
   causing "object has been modified" errors.

Fixes:
- Add explicit DeletionTimestamp check in postgresqlUpdate() to queue the event
- Add DeletionTimestamp check in EventUpdate to call Delete() when set
- Fetch latest object from API before removing finalizer to avoid conflicts

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-06-01 09:18:20 +02:00
laiminhtrung1997 e871a167ed
Add topologySpreadConstraints configuration to pod spec. (#2530)
* Add topologySpreadConstraints configuration to pod spec.
* Run update-codegen.sh to add deepcopy for new field to the api.
* Reuse configured TopologySpreadConstraints for logical backup.
* Remove x-kubernetes-preserve-unknown-fields and XPreserveUnknownFields.
* Add topologySpreadConstraint example in the complete manifest.
* Add support for helm chart.
* Add documentation for topologySpreadConstraint.
* Update e2e test to patch topologySpreadConstraints into the postgresqls manifest.
* For e2e test, updated the PVC retention policy to remove redundant PVCs.
* Fix e2e test, expected PVC count in end-to-end test after config changes.
2026-05-29 17:07:47 +02:00
Sai Asish Y 4d40270890
fix: correct 'occured' typo in error messages (#3094)
* fix: correct 'occured' typo in finalizer error message
* fix: correct 'occured' typo in EBS volume error message
2026-05-11 11:16:37 +02:00
Felix Kunde 618ac156e6
Volume mount length of pooler users (#3093)
* shorten pooler secret mount
* update postgres CRD in helm chart
2026-05-08 17:25:59 +02:00
Mikkel Oscar Lyderik Larsen 3ca1884876
Remove references to registry.opensource.zalan.do (#3092)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2026-05-08 09:16:10 +02:00
Felix Kunde e1713705f4
build multi-arch pooler image (#3077)
* build multi-arch pooler image
* add pooler build step in delivery.yaml and bump pooler version
* pull from docker hub not zalando registry
* add pooler step to ghcr workflow
* pass infra roles to auth file via pooler entrypoint
* introduce extra pooler secret for mounting auth_file
* use pbgouncer as image name and push to ghcr on next merge
* build with latest pgbouncer
* integrate new image in e2e process and update pooler image default
* update pooler build dependencies
* build pooler image for e2e test
* more Makefile and e2e run script tweaking

---------

Co-authored-by: Ida Novindasari <idanovinda@gmail.com>
2026-04-28 13:34:36 +02:00
annielzy 97f4de7cc0
Fix rolling update deadlock when pods are stuck in non-running state (#3051)
* add fix to recreate non running pods in syncStatefulsets

* remove TestSyncStatefulSetNonRunningPodsDoNotBlockRecreatio

* revert pod_test

* pod without status

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
Co-authored-by: Ida Novindasari <idanovinda@gmail.com>
2026-04-28 12:08:34 +02:00
Felix Kunde 688bbf1b9e
update standby check in pooler code (#3088) 2026-04-28 10:17:28 +02:00
Polina Bungina 0ac28e3aad
Do not set aws-load-balancer-connection-idle-timeout by default (#3054)
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-04-24 14:23:54 +02:00
Andreas Mårtensson 27c969d14b
Set securityContext for backup container (#2117)
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-04-24 11:06:30 +02:00
Sai Asish Y 030c24f64e
ui: honor AWS_ENDPOINT in read_basebackups S3 list/get (#3079)
read_stored_clusters and read_versions build their S3 clients with
endpoint_url=AWS_ENDPOINT, but read_basebackups used a bare
client('s3') for both the list_objects_v2 paginator and the per-key
get_object call. On MinIO / S3-compatible backends the list+get
requests go to the default AWS endpoint, so the Backups tab renders
cluster/version prefixes (picked up by the correctly-configured
read_stored_clusters) but then returns empty base backup details
(silently no hits against the real backend) (#3078).

Build s3_client once per call with endpoint_url=AWS_ENDPOINT and reuse
it for both the paginator and get_object. No behaviour change when
AWS_ENDPOINT is unset; boto3 defaults to the AWS endpoint either way.

Fixes #3078

Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>
Co-authored-by: SAY-5 <SAY-5@users.noreply.github.com>
Co-authored-by: Ida Novindasari <idanovinda@gmail.com>
2026-04-23 17:47:51 +02:00