Commit Graph

63 Commits

Author SHA1 Message Date
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 8b404fd049
minor fixes to password rotation (#1796)
* minor fixes to password rotation
* rework unit test
2022-02-25 17:46:26 +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 a78a619e90
toleration diff and nodeReadinessLabel merge with manifest matchExpressions (#1729)
* include tolerations in statefulset comparison
* provide alternative merge behavior of nodeSelectorTerms for node readiness label
* add config option to change affinity merge behavior
* reworked e2e tests around node affinity
2022-01-27 15:57:24 +01:00
Philip Sieder a6d4f23f90
Add user facing ClusterRoles to Helm chart (#1675)
To allow the usage of the [aggregate ClusterRoles]
(https://github.com/zalando/postgres-operator/blob/master/manifests/user-facing-clusterroles.yaml),
an option in the Helm chart is added.

Fixes https://github.com/zalando/postgres-operator/issues/1668

Co-authored-by: Philip Sieder <philip.sieder@tallence.com>
2021-11-19 11:28:17 +01:00
bloever a55639d6b7
Adds required Azure backup env variable WALG_AZ_PREFIX (#1688) 2021-11-19 11:23:44 +01:00
Felix Kunde f9150aa6db
bump operator to v1.7.1 (#1670)
* bump operator to v1.7.1
* update UI image in manifest example
2021-11-03 16:55:01 +01:00
Jairo Llopis 720b4575c7
docs: fix broken links (#1594)
You cannot browse all these links within the published docs in GH pages.
2021-10-18 16:50:27 +02:00
Youki Shiraishi 698377719f
docs: fix typos in credential names (#1627) 2021-09-30 14:34:48 +02:00
Felix Kunde ba6c3c39af
bump operator to v1.7.0 (#1599) 2021-08-27 14:33:54 +02:00
Felix Kunde 7469efac88
enhance docs on clone and restore (#1592)
* enhance docs on clone and restore

* add chapter about upgrading the operator

* add section for standby clusters

* Update docs/administrator.md

Co-authored-by: Alexander Kukushkin <cyberdemn@gmail.com>

Co-authored-by: Alexander Kukushkin <cyberdemn@gmail.com>
2021-08-27 10:44:06 +02:00
Aaron Peschel 1dd0cd9691
Add Support for Azure WAL-G Backups (#1537)
This commit adds support for using an Azure storage account as a backup
location.

It uses the existing GCS functionality as a reference for what to do,
and follows the example set by GCS as closely as possible.

The decision to name the cloud provider key "aws_or_gcp" is unfortunate
while adding support for Azure, but I have left it alone to allow for
this changeset to be backwards compatible.
2021-08-26 14:59:03 +02:00
Igor Yanchenko ebb3204cdd
restart instances via rest api instead of recreating pods, fixes bug with being unable to decrease some values, like max_connections (#1103)
* restart instances via rest api instead of recreating pods
* Ignore differences in bootstrap.dcs when compare SPILO_CONFIGURATION
* isBootstrapOnlyParameter is rewritten, instead of whitelist it uses blacklist
* added e2e test for max_connections decreasing
* documentation updated
* pending_restart flag added to restart api call, wait fot ttl seconds after restart
* refactoring, /restart returns error if pending_restart is set to true and patroni is not pending restart
* restart postgresql instances within pods only if pod's restart is not required
* patroni might need to restart postgresql after pods were recreated if values like max_connections decreased
* instancesRestart is not critical, try to restart pods if not successful
* cleanup

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2021-06-14 11:00:58 +02:00
Felix Kunde a37e78bd9a
bump operator to v1.6.3 (#1503) 2021-05-28 11:53:10 +02:00
Felix Kunde c18241f187
Bump v1.6.2 (#1433)
* helm chart remove 1.6.0 archive from 1.6.0 archive

* bump operator to v1.6.2

* fix pointer deref

* skip connection pooler sync when empty

* revert pooler change and minor update to version msg

* do not log query on error when creating or altering users
2021-04-01 11:53:07 +02:00
Felix Kunde c9acd52700
Major version upgrade config (#1386)
* reflect new major version upgrade options everywhere

* emit events during major version upgrade
2021-03-09 15:28:15 +01:00
Felix Kunde 3962e71ddd
bump to v1.6.1 (#1367)
* bump tp v1.6.1
* update UI chart
* improve docs and manifest examples
* use Spilo 2.0-r4 and update docs
* minor updates to admin docs
2021-02-18 13:38:27 +01:00
Felix Kunde 2eac36d003
update year in generated code and maintainer info in Dockerfiles (#1298)
* update year in generated code and maintainer info in Dockerfiles

* minor update in admin docs
2021-01-08 17:07:28 +01:00
Felix Kunde 102178409b
bump tp v1.6.0 (#1265)
* bump tp v1.6.0
* update logical-backup image
* Using smaller image for e2e test.
* fix env var name in docs
* add postgresql-client-13 to logical backup image

Co-authored-by: Jan Mussler <janm81@gmail.com>
2020-12-18 13:10:35 +01:00
Jan Mussler a63ad49ef8
Initial commit for new 1.6 release with Postgres 13 support. (#1257)
* Initial commit for new 1.6 release with Postgres 13 support.
* Updating maintainers, Go version, Codeowners.
* Use lazy upgrade image that contains pg13.
* fix typo for ownerReference
* fix clusterrole in helm chart
* reflect GCP logical backup in validation
* improve PostgresTeam docs
* change defaults for enable_pgversion_env_var and storage_resize_mode
* explain manual part of in-place upgrade
* remove gsoc docs

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2020-12-17 15:00:29 +01:00
Pavel Tumik db0d089e75
Fix cloning from GCS (#1176)
* Fix clone from gcs

* pass google credentials env var if using GS bucket

* remove requirement for timezone as GCS returns timestamp in local time to the region it is in

* Revert "remove requirement for timezone as GCS returns timestamp in local time to the region it is in"

This reverts commit ac4eb350d9.

* update GCS documentation

* remove sentence about logical backups

* reword pod environment configmap section

* fix documentation
2020-11-03 15:05:44 +01:00
Sergey Dudoladov 4f3bb6aa8c
Remove operator checks that prevent PG major version upgrade (#1160)
* remove checks that prevent major version upgrade

Co-authored-by: Sergey Dudoladov <sergey.dudoladov@zalando.de>
2020-11-02 16:49:29 +01:00
Felix Kunde d658b9672e
PostgresTeam CRD for advanced team management (#1165)
* PostgresTeamCRD for advanced team management

* rework internal structure to be closer to CRD

* superusers instead of admin

* add more util functions and unit tests

* fix initHumanUsers

* check for superusers when creating normal teams

* polishing and fixes

* adding the essential missing pieces

* add documentation and update rbac

* reflect some feedback

* reflect more feedback

* fixing debug logs and raise QueueResyncPeriodTPR

* add two more flags to disable CRD and its superuser support

* fix chart

* update go modules

* move to client 1.19.3 and update codegen
2020-10-28 10:40:10 +01:00
Felix Kunde 3ddc56e5b9
allow delete only if annotations meet configured criteria (#1069)
* define annotations for delete protection

* change log level and reduce log lines for e2e tests

* reduce wait_for_pod_start even further
2020-08-13 16:36:22 +02:00
Christian Rohmann ece341d516
Allow pod environment variables to also be sourced from a secret (#946)
* Extend operator configuration to allow for a pod_environment_secret just like pod_environment_configmap

* Add all keys from PodEnvironmentSecrets as ENV vars (using SecretKeyRef to protect the value)

* Apply envVars from pod_environment_configmap and pod_environment_secrets before doing the global settings from the operator config. This allows them to be overriden by the user (via configmap / secret)

* Add ability use a Secret for custom pod envVars (via pod_environment_secret) to admin documentation

* Add pod_environment_secret to Helm chart values.yaml

* Add unit tests for PodEnvironmentConfigMap and PodEnvironmentSecret - highly inspired by @kupson and his very similar PR #481

* Added new parameter pod_environment_secret to operatorconfig CRD and configmap examples

* Add pod_environment_secret to the operationconfiguration CRD

Co-authored-by: Christian Rohmann <christian.rohmann@inovex.de>
2020-07-30 10:48:16 +02:00
alfredw33 2b0def5bc8
Support for GCS WAL-E backups (#620)
* Support for WAL_GS_BUCKET and GOOGLE_APPLICATION_CREDENTIALS environtment variables

* Fixed merge issue but also removed all changes to support macos.

* Updated test to new format

* Missed macos specific changes

* Added documentation and addressed comments

* Update docs/administrator.md

* Update docs/administrator.md

* Update e2e/run.sh

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2020-06-03 17:33:48 +02:00
Sergey Dudoladov cc635a02e3
Lazy upgrade of the Spilo image (#859)
* initial implementation

* describe forcing the rolling upgrade

* make parameter name more descriptive

* add missing pieces

* address review

* address review

* fix bug in e2e tests

* fix cluster name label in e2e test

* raise test timeout

* load spilo test image

* use available spilo image

* delete replica pod for lazy update test

* fix e2e

* fix e2e with a vengeance

* lets wait for another 30m

* print pod name in error msg

* print pod name in error msg 2

* raise timeout, comment other tests

* subsequent updates of config

* add comma

* fix e2e test

* run unit tests before e2e

* remove conflicting dependency

* Revert "remove conflicting dependency"

This reverts commit 65fc09054b.

* improve cdp build

* dont run unit before e2e tests

* Revert "improve cdp build"

This reverts commit e2a8fa12aa.

Co-authored-by: Sergey Dudoladov <sergey.dudoladov@zalando.de>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2020-04-29 10:07:14 +02:00
Felix Kunde 1d009d9595
bump spilo and pooler version + update docs (#945) 2020-04-28 16:01:13 +02:00
Björn Fischer 168abfe37b
Fully speced global sidecars (#890)
* implement fully speced global sidecars

* fix issue #924
2020-04-27 17:40:22 +02:00
Felix Kunde ba9cf68650
Change type of pod environment config map to NamespacedName (#870)
* allow PodEnvironmentConfigMap in other namespaces
* update codegen
* update docs and comments
2020-03-25 15:59:31 +01:00
Felix Kunde cf829df1a4
define ownership between operator and clusters via annotation (#802)
* define ownership between operator and postgres clusters
* add documentation
* add unit test
2020-03-17 16:34:31 +01:00
Felix Kunde b997e3682f
be more permissive with standbys (#842)
* be more permissive with standbys
* reflect feedback and updated docs
2020-02-24 15:14:14 +01:00
Felix Kunde d5660f65bb
[UI] add tab for monthly costs per cluster (#796)
* add tab for monthly costs per cluster
* sync run_local and update version number
* lowering resources
* some Makefile polishing and updated admin docs on UI
* extend admin docs on UI
* add api-service manifest for operator
* set min limits in UI to default min limits of operator
* reflect new UI helm charts in docs
* make cluster name label configurable
2020-02-19 12:58:24 +01:00
Felix Kunde aea9e9bd33
postgres-pod clusterrole (#832)
* define postgres-pod clusterrole and align rbac in chart
* align UI chart rbac with operator and update doc
* operator RBAC needs podsecuritypolicy to grant it to postgres-pod
2020-02-19 12:32:54 +01:00
Jonathan Juares Beber ba60e15d07 Add ServiceAnnotations cluster config (#803)
The [operator parameters][1] already support the
`custom_service_annotations` config.With this parameter is possible to
define custom annotations that will be used on the services created by the
operator. The `custom_service_annotations` as all the other
[operator parameters][1] are defined on the operator level and do not allow
customization on the cluster level. A cluster may require different service
annotations, as for example, set up different cloud load balancers
timeouts, different ingress annotations, and/or enable more customizable
environments.

This commit introduces a new parameter on the cluster level, called
`serviceAnnotations`, responsible for defining custom annotations just for
the services created by the operator to the specifically defined cluster.
It allows a mix of configuration between `custom_service_annotations` and
`serviceAnnotations` where the latest one will have priority. In order to
allow custom service annotations to be used on services without
LoadBalancers (as for example, service mesh services annotations) both
`custom_service_annotations` and `serviceAnnotations` are applied
independently of load-balancing configuration. For retro-compatibility
purposes, `custom_service_annotations` is still under
[Load balancer related options][2]. The two default annotations when using
LoadBalancer services, `external-dns.alpha.kubernetes.io/hostname` and
`service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout` are
still defined by the operator.
`service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout` can
be overridden by `custom_service_annotations` or `serviceAnnotations`,
allowing a more customizable environment.
`external-dns.alpha.kubernetes.io/hostname` can not be overridden once
there is no differentiation between custom service annotations for
replicas and masters.

It updates the documentation and creates the necessary unit and e2e
tests to the above-described feature too.

[1]: https://github.com/zalando/postgres-operator/blob/master/docs/reference/operator_parameters.md
[2]: https://github.com/zalando/postgres-operator/blob/master/docs/reference/operator_parameters.md#load-balancer-related-options
2020-02-10 12:03:25 +01:00
Felix Kunde 97e0d6d388
extend docs and polish manifest examples (#762) 2019-12-12 17:55:41 +01:00
Felix Kunde a3b34f146f
Add CRD validation (#599)
* add CRD manifests with validation
* update documentation
* patroni slots is not an array but a nested hash map
* make deps call tools
* cover validation in docs and export it in crds.go
* add toggle to disable creation of CRD validation and document it
* use templated service account also for CRD-configured helm deployment
2019-11-28 12:02:05 +01:00
Yujun Zhang aab4d51142 Fix bad formatting in docs (#637)
List requires a proceeding empty line
2019-10-28 16:33:16 +01:00
Erik Inge Bolsø e3b39a5cbe document configmap variant of inherited_labels (#678)
* document configmap varient of inherited_labels and remove application label from cluster example since we will get application:spilo by default
2019-10-05 10:10:02 +02:00
Felix Kunde cd350a4bc1
make run.sh executable from within e2e (#619) 2019-07-24 15:07:32 +02:00
Felix Kunde 0aff809958
use h1 tags to not render titles in sidebar (#626) 2019-07-19 12:50:39 +02:00
Felix Kunde 4eabc8f5db
Initial commit for Postgres Operator UI (#613)
* Initial commit for our basic Postgres Operator UI:
 * Create and modify Postgres manifests
 * Watch Operator Logs in the UI
 * Observe cluster creation progress
 * S3 Backup browser for clone and restore

Many thanks to Manuel Gomez and Jan Mussler for the initial UI work a long time ago!
2019-07-12 17:02:55 +02:00
Felix Kunde 4fc5822b24
Update docs for v1.2 (#609)
* update docs and move parts from README to index.md
* fix typos, headings and code alignment in docs
2019-07-11 17:19:27 +02:00
Markus 93bfed3e75 Add secret mount to operator (#535)
* add secret mount to operator
2019-06-19 12:40:49 +02:00
Felix Kunde 6918394562
Add PDB configuration toggle (#583)
* Don't create an impossible disruption budget for smaller clusters.
* sync PDB also on update
2019-06-18 10:48:21 +02:00
Felix Kunde 5a0e95ac45
Add CRD configuration to Helm chart values.yaml (#559)
* add templates for CRDs incl. crd-install hooks
* support both config styles in values.yaml
* fix ServiceAccount naming in values.yaml
2019-06-03 14:48:32 +02:00
Erik Inge Bolsø ebda39368e database.go: remove hardcoded .svc.cluster.local dns suffix (#561)
* database.go: substitute hardcoded .svc.cluster.local dns suffix with config parameter

Use the pod's configured dns search path, for clusters where .svc.cluster.local is not correct.
2019-05-31 16:32:00 +02:00
Sergey Dudoladov 3ffc8ac5fa
Sample logical backup image. (#572)
* Sample logical backup image.

Based on the earlier work by Dmitry Dolgov @erthalion
2019-05-31 15:51:58 +02:00
Sergey Dudoladov f3e1e80aaf
Add logical backup (#442)
* Add k8s cron job to spawn logical backups

* Minor doc updates
2019-05-16 15:52:01 +02:00