Commit Graph

57 Commits

Author SHA1 Message Date
Ida Novindasari 470a1eab89
Add support for pg17 and remove pg12 (#2773)
* Add support for pg17
* use new gcov2lcov-action
* Use ghcr spilo-17
* Update SPILO_CURRENT and SPILO_LAZY
* Update e2e/run.sh

---------

Co-authored-by: Polina Bungina <27892524+hughcapet@users.noreply.github.com>
2024-12-20 11:22:52 +01:00
Felix Kunde 80ef38f7f0
add resource annotation and ignore recovery type (#2817)
* add resource annotation and ignore recovery type
* Update docs/reference/cluster_manifest.md

---------

Co-authored-by: Ida Novindasari <idanovinda@gmail.com>
2024-12-16 18:17:19 +01:00
Polina Bungina 2582b934bf
MaintenanceWindow CRD validation reflects the implementation (#2731) 2024-08-20 14:43:12 +02:00
Felix Kunde 85b8058029
bump spilo to 16-3.3, drop support for pg11 (#2706)
* bump spilo to 16-3.3, drop support for pg11
* update README
2024-08-09 14:47:23 +02:00
Felix Kunde b550f8ae39
fix unit test for new subPathExpr feature (#2638)
* fix unit test for new subPathExpr feature
* add subPathExpr flag to CRD and re-sort
2024-05-24 15:07:17 +02:00
Samuel Mutel 7bcb73a402
feat: Add SubPathExpr option for additionalVolumes (#2463) 2024-05-24 11:55:22 +02:00
Felix Kunde 5357062857
add logical backup retention as manifest option (#2621)
* add logical backup retention as manifest option
* added unit test for logical backup envvar generation
2024-04-29 10:58:52 +02:00
Jociele Padilha a5663da64f
add the pg version 16 (#2557)
* add the pg version 16

* add comma after pg16 in crds api

* change minimal_major_version to 12

* add new spilo image for pg16

* edit the registry from current and lazy spilo

* Update e2e/run.sh

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>

* Update README.md

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>

* add pg 11 to be compatible for the existing DBs

* update pq, pyyaml,k8s and kind version

* skip test_infrastructure_roles

* skip another test

* remove the skipping

* adjust the verification of new Patroni version states

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2024-03-13 16:43:25 +01:00
tm604 a63a0758de
Add support for PostgreSQL 16 (#2437)
* Add support for PostgreSQL 16
* Include pg16 in local script and logical-backup Dockerfile

---------

Co-authored-by: Tom Molesworth <tom@audioboundary.com>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2024-03-05 15:43:33 +01:00
Felix Kunde 886cb86797
allow users to opt out from globally enabled secret rotation (#2528)
* allow users to opt out from globally enabled secret rotation
* cover new option also in e2e test
* change ignore test to existing user
2024-02-09 12:19:06 +01:00
Silas 9581ba969b
Add hugepages 2Mi and 1Gi fields to ResourceDescription and pass them to the statefulset (#2311)
* Add hugepages-2Mi and 1Gi to ResourceDescription type and crd (#1549, #1788)
* Add tests for hugepages resource requests/limits
* Add tests for hugepages resource requests/limits on sidecars, too
* Add docs for hugepages support
* Add link to kubernetes docs on hugepages
* Add tests for hugepages not being set on container if not requested in custom resource
* Add hugepages resources fields to manifest docs
* Add hugepages resources fields to complete manifest example
* Add hugepages resources fields to chart crd

---------

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2024-01-04 15:59:27 +01:00
Felix Kunde dc872abb51
support new stream fields in CRD (#2427) 2023-09-20 11:57:49 +02:00
Owen Ou 021ab07a23
Introduce `masterServiceAnnotations` & `replicaServiceAnnotations` (#2161)
* Introduce `masterServiceAnnotations` & `replicaServiceAnnotations`

Introduce `masterServiceAnnotations` & `replicaServiceAnnotations` to the `Postgresql` CRD.
`masterServiceAnnotations` overrides `serviceAnnotations` for master role if not empty.
`replicaServiceAnnotations` overrides `serviceAnnotations` for replica role if not empty.
Existing definition of `serviceAnnotations` continue to work for backward compatibitlity when neither `masterServiceAnnotations` nor `replicaServiceAnnotations` is defined.

This closes https://github.com/zalando/postgres-operator/issues/1927

* Accumulate service annotations

First, global config, then ServiceAnnotations overriding, then MasterServiceAnnotations and ReplicaServiceAnnotations.

This addresses
https://github.com/zalando/postgres-operator/pull/2161#discussion_r1063558711.

* Update admin doc with master & replica service annotations overrides

Addressed https://github.com/zalando/postgres-operator/pull/2161#discussion_r1064744086

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2023-01-11 13:29:16 +01:00
Felix Kunde 3e148ea57e
enable operator support for pg15 and drop support for 9.5 and 9.6 (#2140)
* enable operator support for pg15 and drop support for 9.5 and 9.6
* not offer 15 in UI before spilo-15 is available
2022-12-15 12:17:27 +01:00
Polina Bungina 4d585250db
Add Patroni failsafe_mode parameter (#2076)
This commit adds support of a not-yet-released Patroni feature that allows postgres to run as primary in case of a failed leader lock update.
* Add Patroni 'failsafe_mode' local parameter (enable for a single PG cluster)
* Allow configuring Patroni 'failsafe_mode' parameter globally
2022-12-02 13:33:02 +01:00
Soltvedt ad320488b0
Fixes a typo in the CRD yaml files. (#1941)
Replaces 'DoesNotExists' with 'DoesNotExist'. Fixes #1868.

Co-authored-by: Stian Soltvedt <stsol@fiskeridir.no>
2022-06-28 11:02:34 +02:00
Felix Kunde 9eb7517218
sync CRD with example manifests (#1869) 2022-04-25 18:16:05 +02:00
Dmitry Volodin 9bcb25ac7e
Ability to set pod environment variables on cluster resource (#1794)
* Ability to set pod environment variables on cluster resource

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2022-04-11 10:16:35 +02:00
Felix Kunde 0dc370f15d
standby cluster that streams from a remote primary (#1830)
* add the possibility to create a standby cluster that streams from a remote primary
* extending unit tests
* add more docs and e2e test

Co-authored-by: machine424 <ayoubmrini424@gmail.com>
2022-04-04 15:41:11 +02:00
Felix Kunde 36df1bc87c
refactor GenerateResourceRequirements and provide unit tests (#1822)
* refactor GenerateResourceRequirements and provide unit tests
2022-03-24 17:35:00 +01:00
preved911 38db48c7f0
fixing toleration fields requirements (#1797)
Signed-off-by: Ildar Valiullin <preved.911@gmail.com>
2022-03-21 16:05:45 +01:00
Felix Kunde d032e4783e
LoadBalancer toggles for master and replica pooler pods (#1799)
* Add support for pooler load balancer

Signed-off-by: Sergey Shatunov <me@prok.pw>

* Rename to enable_master_pooler_load_balancer

Signed-off-by: Sergey Shatunov <me@prok.pw>

* target port should be intval
* enhance pooler e2e test
* add new options to crds.go

Co-authored-by: Sergey Shatunov <me@prok.pw>
2022-03-04 13:36:17 +01:00
Felix Kunde d8a159ef1a
create CDC event stream CRD (#1570)
* provide event stream API
* check manifest settings for logical decoding before creating streams
* operator updates Postgres config and creates replication user
* name FES like the Postgres cluster
* add delete case and fix updating streams + update unit test
* check if fes CRD exists before syncing
* existing slot must use the same plugin
* make id and payload columns configurable
* sync streams only when they are defined in manifest
* introduce applicationId for separate stream CRDs
* add FES to RBAC in chart
* disable streams in chart
* switch to pgoutput plugin and let operator create publications
* reflect code review and additional refactoring

Co-authored-by: Paŭlo Ebermann <paul.ebermann@zalando.de>
2022-02-28 10:09:42 +01:00
Menzorg 06c28da97d
synchronous_node_count support (#1484)
* synchronous_node_count support
* notification about Patroni image version
* default synchronous_node_count to 1

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2022-02-25 17:21:42 +01:00
Felix Kunde 3ce0b1e7fa
deprecate crd validation toggle and sync with manifests (#1781)
* deprecate crd validation toggle and sync with manifests
* fix description in pg crd manifests
* change CRD creation strategy
* affinity matchExpression has values
* lower repair period in e2e tests
2022-02-18 15:04:31 +01:00
Felix Kunde 658923d10d
Password rotation in secrets (#1749)
* password rotation in K8s secrets
* add db connection to syncSecrets
* add user retention
* add e2e test
* cleanup on username mismatch if rotation was switched off
* add unit test for syncSecrets + new updateSecret func
2022-02-18 11:54:47 +01:00
Felix Kunde 411abbe31e
handle case when Patroni returns that lag is unknown (#1724)
* handle case when Patroni returns that lag is unknown
* remove some prints from e2e test
2021-12-17 12:36:23 +01:00
Felix Kunde ab25fb29b7
make Postgres 14 available (#1636)
* make Postgres 14 available
* don't be too hard to 9.5
* bump Spilo image and more docs updates
* update e2e test upgrading to 14
2021-10-12 12:00:59 +02:00
John Rood 2d2ce6197b
Add volume selector (#1385)
* Add volume selector
* Add slightly better documentation and gofmt changes
* Update generated deepcopy
* Add test for PV selector

Co-authored-by: John Rood <j.rood@picturae.com>
2021-08-26 14:57:54 +02:00
Felix Kunde 282b6d2863
allow secrets of default users in a different namespace (#1581)
* allow secrets of default users in a different namespace
* add warning in case secretNamespace is ignored
2021-08-18 16:00:26 +02:00
Felix Kunde 2057ad8191
reorder e2e tests to follow alphabetical sorting (#1567)
* reorder e2e tests to follow alphabetical sorting
* e2e: finish waiting for pod failover only if all pods were replaced
* wait for sync in rolling update timeout test
2021-07-27 11:41:27 +02:00
Felix Kunde a37e78bd9a
bump operator to v1.6.3 (#1503) 2021-05-28 11:53:10 +02:00
Jan Mussler 4a88f00a3f
Full AWS gp3 support for iops and througput config. (#1261)
Support new AWS EBS volume type `gp3` with `iops` and `throughput` in the manifest.

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2021-01-25 10:07:18 +01:00
Pavel Tumik 77252e316c
Add node affinity support (#1166)
* Adding nodeaffinity support alongside node_readiness_label
* add documentation for node affinity
* add node affinity e2e test
* add unit test for node affinity

Co-authored-by: Steffen Pøhner Henriksen <str3sses@gmail.com>
Co-authored-by: Adrian Astley <adrian.astley@activision.com>
2020-12-16 14:56:28 +01:00
Pavel Tumik 5076e669cb
Fix timestamp regex (#1178) 2020-12-16 11:17:08 +01:00
Boyan Bonev 85d1a72cd6
Add scheduler name support - [Update #990] (#1226)
* Add ability to specify alternative schedulers via schedulerName.

Co-authored-by: micah.coletti@gmail.com <micah.coletti@gmail.com>
2020-11-25 10:55:05 +01:00
Felix Kunde cfd83e33c8
preserving fields only when using k8s specs (#1228)
* preserving fields when k8s specs are used with x-kubernetes-preserve-unknown-fields flag
* cleaning up merge errors in postgresql and operatorconfiguration CRD
* add operatorconfiguration CRD and sample manifests in setUpClass of e2e tests
* update generated code and go modules
2020-11-24 16:23:22 +01:00
Felix Kunde 3e42e8a896
CRD: preserve unknown fields and add to all category (#1212)
* CRD: preserve unknown fields and add to all category

* allow Pg13

* left over
2020-11-16 10:29:01 +01:00
Rafia Sabih 49158ecb68
Connection pooler for replica (#1127)
* Enable connection pooler for replica
* Refactor code for connection pooler
  - Move all the relevant code to a separate file
  - Move all the related tests to a separate file
  - Avoid using cluster where not required
  - Simplify the logic in sync and other methods
  - Cleanup of duplicated or unused code
* Fix labels for the replica pods
* Update deleteConnectionPooler to include role
* Adding test cases and other changes
   - Fix unit test and delete secret when required only
   - Make sure we use empty fresh cluster for every test case.
* enhance e2e test
* Disable pooler in complete manifest as this is source for e2e too an creates unnecessary pooler setups.

Co-authored-by: Rafia Sabih <rafia.sabih@zalando.de>
Co-authored-by: Jan Mussler <janm81@gmail.com>
2020-11-13 14:52:21 +01:00
Felix Kunde 9a824c38f4
fix identation in operatorconfiguration CRD and jsonPath case (#1195)
* fix identation in operatorconfiguration CRD

* fix jsonPath field case
2020-11-05 11:49:24 +01:00
Felix Kunde d76419565b
move to apiextensions from v1beta1 to v1 (#746)
* move to apiextensions from v1beta1 to v1

* remove metadata from CRD validation

* some forgotten change
2020-11-02 10:49:29 +01:00
Felix Kunde 22fa0875e2
add maxLength constraint for CRD (#1175)
* add maxLength constraint for CRD
2020-10-22 08:44:04 +02:00
Rico Berger d09e418b56
Set user and group in security context (#1083)
* Set user and group in security context
2020-09-15 13:27:59 +02:00
Felix Kunde 3d976ebe8b
include volume in list of required fields (#1016)
Co-authored-by: Felix Kunde <felix.kunde@zalando.de>
2020-06-12 15:09:59 +02:00
Felix Kunde 3c352fb460
bump pooler image and more coalescing for CRD config (#1004)
Co-authored-by: Felix Kunde <felix.kunde@zalando.de>
2020-06-05 11:14:17 +02:00
Felix Kunde d76203b3f9
Bootstrapped databases with best practice role setup (#843)
* PreparedDatabases with default role setup

* merge changes from master

* include preparedDatabases spec check when syncing databases

* create a default preparedDB if not specified

* add more default privileges for schemas

* use empty brackets block for undefined objects

* cover more default privilege scenarios and always define admin role

* add DefaultUsers flag

* support extensions and defaultUsers for preparedDatabases

* remove exact version in deployment manifest

* enable CRD validation for new field

* update generated code

* reflect code review

* fix typo in SQL command

* add documentation for preparedDatabases feature + minor changes

* some datname should stay

* add unit tests

* reflect some feedback

* init users for preparedDatabases also on update

* only change DB default privileges on creation

* add one more section in user docs

* one more sentence
2020-04-29 10:56:06 +02:00
ReSearchITEng 7e8f6687eb
make tls pr798 use additionalVolumes capability from pr736 (#920)
* make tls pr798 use additionalVolumes capability from pr736

* move the volume* sections lower

* update helm chart crds and docs

* fix user.md typos
2020-04-15 15:24:55 +02:00
Thierry Sallé ea3eef45d9
Additional volumes capability (#736)
* Allow additional Volumes to be mounted

* added TargetContainers option to determine if additional volume need to be mounter or not

* fixed dependencies

* updated manifest additional volume example

* More validation

Check that there are no volume mount path clashes or "all" vs ["a", "b"]
mixtures. Also change the default behaviour to mount to "postgres"
container.

* More documentation / example about additional volumes

* Revert go.sum and go.mod from origin/master

* Declare addictionalVolume specs in CRDs

* fixed k8sres after rebase

* resolv conflict

Co-authored-by: Dmitrii Dolgov <9erthalion6@gmail.com>
Co-authored-by: Thierry <thierry@malt.com>
2020-04-15 09:13:35 +02:00
Leon Albers 4dee8918bd
Allow configuration of patroni's replication mode (#869)
* Add patroni parameters for `synchronous_mode`

* Update complete-postgres-manifest.yaml, removed quotation marks

* Update k8sres_test.go, adjust result for `Patroni configured`

* Update k8sres_test.go, adjust result for `Patroni configured`

* Update complete-postgres-manifest.yaml, set synchronous mode to false in this example

* Update pkg/cluster/k8sres.go

Does the same but is shorter. So we fix that it if you like.

Co-Authored-By: Felix Kunde <felix-kunde@gmx.de>

* Update docs/reference/cluster_manifest.md

Co-Authored-By: Felix Kunde <felix-kunde@gmx.de>

* Add patroni's `synchronous_mode_strict`

* Extend `TestGenerateSpiloConfig` with `SynchronousModeStrict`

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2020-04-06 14:27:17 +02:00
Felix Kunde b43b22dfcc
Call me pooler, not pool (#883)
* rename pooler parts and add example to manifest
* update codegen
* fix manifest and add more details to docs
* reflect renaming also in e2e tests
2020-04-01 10:34:03 +02:00