Commit Graph

1542 Commits

Author SHA1 Message Date
Trent Schmidt 6a5c36231b
Merge branch 'master' into trent--pooler-priority 2026-08-11 11:28:03 -07:00
adshin21 bbc3eab7e0
Skip owner references on user secrets when secret deletion is disabled (#3165)
* Skip owner references on user secrets when secret deletion is disabled

Kubernetes garbage-collects owner-referenced secrets as soon as the
owning Postgresql resource is deleted, regardless of the operator's
own EnableSecretsDeletion check in Delete() (which only guards the
operator's explicit deleteSecrets() call, not GC). This made
enable_secrets_deletion=false ineffective whenever
enable_owner_references was also enabled, since GC removed the
credential secrets anyway.

Now the generated secrets are not removed when
enable_owner_references: true, enable_secrets_deletion: false.

* Document skip-owner-refs on user secrets when deletion disabled

- refresh inline comment in generateSingleUserSecret
- extend enable_owner_references / enable_secrets_deletion docs in
  operator_parameters.md to describe the interaction
- clarify in operator_parameters.md that the protection takes effect
  on the cluster's next sync after the setting is applied
- add third exception in administrator.md "Owner References and Finalizers"
- add TestGenerateSingleUserSecret_OwnerReferences covering all four
  flag combinations plus the cross-namespace cases

---------

Co-authored-by: Serdar Dalgıç <sd@serdardalgic.org>
2026-08-11 17:22:39 +02:00
rasoanaivo-r b43c7be1d0
fix operatorconfigurations CRD: render sidecars as array (#3160)
configuration.sidecars was annotated with kubebuilder:validation:Type=object
while SidecarContainers is a []v1.Container, so the generated schema rejected
every list value and global sidecars could not be configured at all.

Drop the hand-written Schemaless/Type=object markers and let controller-gen
derive the schema from the Go type, the same way spec.initContainers is
already handled in the Postgresql CRD. The field now renders as type: array
with a full Container schema for its items.

Fixes #3159

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 17:10:05 +02:00
Jan Mussler bd8e361f65
Add deployment strategy type 'Recreate' (#3164)
Add deployment strategy type 'Recreate'
2026-08-11 09:14:13 +02:00
Trent Schmidt 8fa52457c5
Merge branch 'master' into trent--pooler-priority 2026-07-30 17:05:23 -07:00
Felix Kunde a7aaad0a0b
update helm chart index (#3148) 2026-07-30 12:43:52 +02:00
Felix Kunde a2585e3ee1
prepare bugfix release (#3147) 2026-07-29 10:51:00 +02:00
Trent Schmidt af993ec626
Merge branch 'master' into trent--pooler-priority 2026-07-28 13:13:37 -07:00
Felix Kunde dd230d631d
[helm] incl. latest bug fixes in v2 charts (#3146) 2026-07-28 17:20:01 +02:00
IO ANALYTICA 66adeddcb7
Fix invalid JSON (trailing comma) in operator-ui OPERATOR_UI_CONFIG (#3144)
The postgresql_versions array had a trailing comma after "14" in two places
that build OPERATOR_UI_CONFIG as JSON. OPERATOR_UI_CONFIG is parsed by the UI
with Python's json.loads() (operator_ui/main.py), which rejects trailing
commas, so the config fails to load:

  json.decoder.JSONDecodeError: Expecting value: line 25 column 3

Remove the trailing comma in:
- charts/postgres-operator-ui/templates/deployment.yaml (chart Deployment)
- ui/run_local.sh (local dev default_operator_ui_config)

ui/manifests/deployment.yaml and the Python DEFAULT_UI_CONFIG in
operator_ui/main.py were already correct.

Fixes #3062
2026-07-28 16:27:06 +02:00
IO ANALYTICA 29168ca0bc
Fix operatorconfigurations CRD: NamespacedName must render as type string (#3145)
Upgrading to v2.0.0 fails at the CRD apply step. The apiserver rejects the
OperatorConfiguration CRD:

  CustomResourceDefinition "operatorconfigurations.acid.zalan.do" is invalid:
  ...oauth_token_secret_name.default: Invalid value: "string": in body must
  be of type object

Root cause: these CRDs are generated by controller-gen from the Go types.
spec.NamespacedName is a struct {Namespace, Name}, so controller-gen emits an
object schema for every NamespacedName field. But NamespacedName has custom
MarshalJSON/UnmarshalJSON that (de)serialize it as a plain JSON string
("namespace/name"). The generated object schema therefore never matched how
the operator actually reads and writes these fields (it did in 1.15.x, where
they were type: string).

For oauth_token_secret_name this is a hard failure: it also carries
`// +kubebuilder:default=postgres-operator`, and a scalar string default on an
object-typed property is rejected by the apiserver, blocking the whole
1.15.x -> 2.0.0 upgrade before the operator Deployment is touched.

Fix at the source by annotating the NamespacedName type with
`// +kubebuilder:validation:Type=string` and regenerating the CRDs. This makes
controller-gen emit `type: string` for all NamespacedName fields
(oauth_token_secret_name, infrastructure_roles_secret_name,
pod_environment_configmap, and the nested infrastructure role secretname),
matching their runtime serialization and restoring 1.15.x behaviour. A
field-level Type override cannot be used here: it conflicts with the
struct-derived schema ("object vs string in allOf") and fails generation.

Regenerated manifests/operatorconfiguration.crd.yaml and its two synced
copies (pkg/apis/... embed source and charts/.../crds). Verified with a
server-side dry-run apply: the unpatched CRD is rejected, the regenerated CRD
is accepted.

Fixes #3143
2026-07-28 16:02:59 +02:00
Felix Kunde 8eda2cd1a2
bump to v2.0 (#3134)
* bump to v2.0
* update docs and remove some diagrams
* update crd in charts dir
* update helm charts
* reflect docs feedback
2026-07-27 23:50:17 +02:00
Trent Schmidt 8d67543106
Merge branch 'master' into trent--pooler-priority 2026-07-27 09:06:41 -07:00
Juhani Pelli 4c1bb1c0ea
Use maxUnavailable for the critical-op PDB to stop idle alert noise (#3141)
* Use maxUnavailable for the critical-op PDB to stop idle alert noise

The critical-op PDB is created with minAvailable equal to
numberOfInstances while its selector (critical-operation=true) matches
no pods during normal operation. This leaves status.desiredHealthy at N
and currentHealthy at 0 permanently, so monitoring stacks fire alerts
like kube-prometheus-stack's KubePdbNotEnoughHealthyPods for every idle
cluster (#3020).

maxUnavailable: 0 provides the same protection while a critical
operation is running - no voluntary evictions of labeled pods - but
keeps the budget satisfied (desiredHealthy 0) when nothing matches.
When PDBs are disabled or there are no instances, the budget relaxes to
maxUnavailable 100% instead of minAvailable 0.

Fixes #3020

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Update PDB docs for critical-op maxUnavailable semantics

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Clarify why the two PDBs use different budget fields

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2026-07-27 17:36:42 +02:00
Felix Kunde d268c589c2
change volume specs to int32 and define max iops and throughput values (#3139)
* change int64 volume specs to int32 like in used AWS lib
* upper iops and throughput limits
* minor refactoring in ebs.go
2026-07-27 16:32:22 +02:00
Felix Kunde 56a8f1d90b
remove gp3 migration flow (#3142) 2026-07-27 14:02:44 +02:00
Trent Schmidt 56e78cec61
Merge branch 'master' into trent--pooler-priority 2026-07-24 13:26:34 -07:00
Felix Kunde bffde0f5e7
fix type deference when calling ebs modify volume endpoint (#3140)
* fix type deference when calling ebs modify volume endpoint
* only pass set variable to modify input
2026-07-24 16:39:41 +02:00
Felix Kunde 0ea05f7691
Fix no space left error during e2e test setup (#3138)
* fix space issues for e2e test
* pin exact minor release of coveralls
2026-07-24 09:15:26 +02:00
Trent Schmidt 4ccea88d54
Merge branch 'master' into trent--pooler-priority 2026-07-23 08:19:29 -07: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
Trent Schmidt e09ff7a570
feat(pooler): support priorityClassName for connection pooler pods
Add priorityClassName to the connectionPooler cluster spec and a
connection_pooler_priority_class_name operator config default.
Cluster spec overrides the operator default; unset means no priority
class. Applies to both master and replica pooler deployments and is
reconciled on config drift.
2026-07-22 11:49:43 -07: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