Commit Graph

27 Commits

Author SHA1 Message Date
Felix Kunde a87307e56b
Feat: enable owner references (#2688)
* feat(498): Add ownerReferences to managed entities
* empty owner reference for cross namespace secret and more tests
* update ownerReferences of existing resources
* removing ownerReference requires Update API call
* CR ownerReference on PVC blocks pvc retention policy of statefulset
* make ownerreferences optional and disabled by default
* update unit test to check len ownerReferences
* update codegen
* add owner references e2e test
* update unit test
* add block_owner_deletion field to test owner reference
* fix typos and update docs once more
* reflect code feedback

---------

Co-authored-by: Max Begenau <max@begenau.com>
2024-08-09 17:58:25 +02:00
Polina Bungina 47efca33c9
Improve inherited annotations (#2657)
* Annotate PVC on Sync/Update, not only change PVC template
* Don't rotate pods when only annotations changed
* Annotate Logical Backup's and Pooler's pods
* Annotate PDB, Endpoints created by the Operator, Secrets, Logical Backup jobs

Inherited annotations are only added/updated, not removed
2024-06-26 13:10:37 +02: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
Felix Kunde 4ea0b5f432
set AllowPrivilegeEscalation on container securityContext (#1326) 2021-01-22 14:06:19 +01:00
Felix Kunde 3fed565328
check resize mode on update events (#1194)
* check resize mode on update events

* add unit test for PVC resizing

* set resize mode to pvc in charts and manifests

* add test for quantityToGigabyte

* just one debug line for syncing volumes

* extend test and update log msg
2020-11-11 13:22:43 +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 865d5b41a7
set event broadcasting to Infof and update rbac (#952) 2020-04-29 17:26:46 +02:00
Christian Rohmann 21b9b6fcbe
Emit K8S events to the postgresql CR as feedback to the requestor / user (#896)
* Add EventsGetter to KubeClient to enable to sending K8S events

* Add eventRecorder to the controller, initialize it and hand it down to cluster via its constructor to enable it to emit events this way

* Add first set of events which then go to the postgresql custom resource the user interacts with to provide some feedback

* Add right to "create" events to operator cluster role

* Adapt cluster tests to new function sigurature with eventRecord (via NewFakeRecorder)

* Get a proper reference before sending events to a resource

Co-authored-by: Christian Rohmann <christian.rohmann@inovex.de>
2020-04-27 08:22:07 +02:00
Dmitry Dolgov 9dfa433363
Connection pooler (#799)
Connection pooler support

Add support for a connection pooler. The idea is to make it generic enough to
be able to switch between different implementations (e.g. pgbouncer or
odyssey). Operator needs to create a deployment with pooler and a service for
it to access.

For connection pool to work properly, a database needs to be prepared by
operator, namely a separate user have to be created with an access to an
installed lookup function (to fetch credential for other users).

This setups is supposed to be used only by robot/application users. Usually a
connection pool implementation is more CPU bounded, so it makes sense to create
several pods for connection pool with more emphasize on cpu resources. At the
moment there are no special affinity or tolerations assigned to bring those
pods closer to the database. For availability purposes minimal number of
connection pool pods is 2, ideally they have to be distributed between
different nodes/AZ, but it's not enforced in the operator itself. Available
configuration supposed to be ergonomic and in the normal case require minimum
changes to a manifest to enable connection pool. To have more control over the
configuration and functionality on the pool side one can customize the
corresponding docker image.

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2020-03-25 12:57:26 +01:00
Felix Kunde b24da3201c
bump version to 1.4.0 + some polishing (#839)
* bump version to 1.4.0 + some polishing
* align version for UI chart
* update user docs to warn for standby replicas
* minor log message changes for RBAC resources
2020-02-25 09:50:54 +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
Felix Kunde 702a194c41
switch to rbac/v1 (#829)
* switch to rbac/v1
2020-02-17 11:25:07 +01:00
Felix Kunde 3b10dc645d
patch/update services on type change (#824)
* use Update when disabling LoadBalancer + added e2e test
2020-02-13 16:24:15 +01:00
Felix Kunde 629feac98f
Remove bind verb and explain privileges (#765)
Closes #256
2019-12-16 17:07:36 +01:00
Felix Kunde f9487e41c1 inject cluster name label into logical backup pod (#725)
* inject cluster name label into logical backup pod
2019-11-20 13:58:41 +01:00
Felix Kunde 63d1f3bbe4
add get for deployments to operator RBAC (#724) 2019-11-18 12:13:05 +01:00
Emre Hasegeli b738283f6f charts: Add pods/exec permission (#694) 2019-10-23 11:22:23 +02:00
Felix Kunde 4a099d698d
bump to v1.2.0 (#631)
* bump to v1.2.0
* yaml lint: add one more space before incline comments
2019-07-25 12:23:53 +02:00
Taehyun Kim 0ed92ed04e add deletecollection verb (#589)
Fixing privileges to execute `patronictl remove`.

You could/should have also just used the operator delete cluster flow (remove manifest). It is not really the plan to use patroni inside a pod to remove a existing cluster.
2019-06-19 10:47:27 +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
Felix Kunde 4b9e6058e1 add update for CRD to RBAC (#564) 2019-05-13 17:36:15 +02:00
Felix Kunde ad0b250b5b
patch CRD on operator update (#558)
* patch existing CRD each time there is an operator update
2019-05-09 12:35:15 +02:00
Felix Kunde 0fbfbb23bb
Use /status subresource instead of plain manifest field (#534)
* turns PostgresStatus type into a struct with field PostgresClusterStatus
* setStatus patch target is now /status subresource
* unmarshalling PostgresStatus takes care of previous status field convention
* new simple bool functions status.Running(), status.Creating()
2019-05-07 12:01:45 +02:00
jens-totemic f25351c36a Make OperatorConfiguration work (#410)
* Fixes # 404
2018-11-13 11:22:07 +01:00
zerg-junior 417f13c0bd
Submit RBAC credentials during initial Event processing (#344)
* During initial Event processing submit the service account for pods and bind it to a cluster role that allows Patroni to successfully start. The cluster role is assumed to be created by the k8s cluster administrator.
2018-07-19 16:40:40 +02:00
zerg-junior 9c86f8bd96
Fix conf for minikube (#301)
* Bump up a Spilo version to use Patroni >= v1.4.4 ; this fixes issues with k8s 1.10 API changes

* Bump up an operator version to use the new 'etcd_host' default value

* Re-use 'zalando-postgres-operator' as a pod service account and add extra RBAC permissions to make it work

* Document in quickstart connecting to Postgres via psql
2018-05-25 12:25:42 +02:00
Sergey Dudoladov 83a26fb78b Rename RBAC file 2018-05-17 12:05:31 +02:00