Commit Graph

966 Commits

Author SHA1 Message Date
Jan Mußler 791f0de951 one more example. 2020-11-05 10:25:01 +01:00
Jan Mußler 992077b07f Fix oldSpec nil for tests. 2020-11-05 09:26:34 +01:00
Jan Mußler 085d0da6a9 Added example for fake client. 2020-11-04 23:43:57 +01:00
Jan Mußler 1e10549e43 More debug output for trouble shooting of missing sync. 2020-11-04 21:32:09 +01:00
Rafia Sabih c0e6270962 sleep more for sync 2020-11-04 10:56:56 +01:00
Rafia Sabih 0a0f1c7488 fix e2e and some flake8 2020-11-04 10:32:36 +01:00
Rafia Sabih 9de57f0182 fix unit tests and other minor changes 2020-11-04 07:56:34 +01:00
Rafia Sabih 2b44eff294 fix unit test and delete secret when required only 2020-11-03 15:57:24 +01:00
Rafia Sabih 041b9eec52 Enhance e2e test and other fixes 2020-11-03 15:36:52 +01:00
Rafia Sabih d65dc51729 fix e2e 2020-11-03 10:34:56 +01:00
Rafia Sabih ce2b77c255 minor fixes 2020-11-03 10:00:10 +01:00
Rafia Sabih 24668716db wait before checking for sync 2020-11-02 16:03:15 +01:00
Rafia Sabih 79cdf08cf0 sleep more to get in sync 2020-11-02 15:26:36 +01:00
Rafia Sabih 65d547f740 enhance e2e test 2020-11-02 14:48:02 +01:00
Rafia Sabih 5685924cdf Merge branch 'master' into replica-pooler 2020-10-29 14:14:57 +01:00
Jan Mussler 7f7beba66b
Improving e2e more (#1185)
* Add curl to operator image.

* Wait for idle operator in delete.
2020-10-29 13:59:22 +01:00
Rafia Sabih fd18e02f2a merge master 2020-10-29 13:36:07 +01:00
Jan Mussler c694a72352
Make failure in retry a warning not an error. (#1188) 2020-10-29 13:12:25 +01:00
Rafia Sabih 133f77c330
Refactor connection pooler (#1159)
Refactor connection_pooler code

- 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

Co-authored-by: Rafia Sabih <rafia.sabih@zalando.de>
2020-10-29 12:05:53 +01:00
Felix Kunde 9a11e85d57
disable PostgresTeam by default (#1186)
* disable PostgresTeam by default

* fix version in chart
2020-10-28 17:51:37 +01:00
Jakub Warczarek e10e0fec9e
Add support in UI for custom S3 endpoints for backups (#1152)
* Support custom S3 endpoint for backups

* Log info about AWS S3 endpoint during start up
2020-10-28 10:56:50 +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
Jan Mussler 3a86dfc8bb
End 2 End tests speedup (#1180)
* Improving end 2 end tests, especially speed of execution and error, by implementing proper eventual asserts and timeouts.
* Add documentation for running individual tests
* Fixed String encoding in Patorni state check and error case
* Printing config as multi log line entity, makes it readable and grepable on startup
* Cosmetic changes to logs. Removed quotes from diff. Move all object diffs to text diff. Enabled padding for log level.
* Mount script with tools for easy logaccess and watching objects.
* Set proper update strategy for Postgres operator deployment.
* Move long running test to end. Move pooler test to new functions.
* Remove quote from valid K8s identifiers.
2020-10-28 10:04:33 +01:00
arminfelder 7730ecfdec
fixed case where, no ready label is defined, but node is unscheduable (#1162)
* fixed case where, no ready label is defined, but node is unscheduable
2020-10-28 09:33:52 +01:00
Rafia Sabih 2d20982913 conflict resolution for master merge 2020-10-27 17:42:23 +01:00
Felix Kunde e97235aa39
update dependencies oct 2020 (#1184)
* update dependencies oct 2020

* update codegen
2020-10-27 16:59:26 +01:00
preved911 d9f5d1c9df
changed PodEnvironmentSecret location namespace (#1177)
Signed-off-by: Ildar Valiullin <preved.911@gmail.com>
2020-10-22 08:49:30 +02:00
Felix Kunde 22fa0875e2
add maxLength constraint for CRD (#1175)
* add maxLength constraint for CRD
2020-10-22 08:44:04 +02:00
刘新 a8bfe4eb87
Remove repeated initialization of Pod ServiceAccount (#1164)
Co-authored-by: xin.liu <xin.liu@woqutech.com>
2020-10-20 14:18:22 +02:00
Dmitry Dolgov 1f5d0995a5
Lookup function installation (#1171)
* Lookup function installation

Due to reusing a previous database connection without closing it, lookup
function installation process was skipping the first database in the
list, installing twice into postgres db instead. To prevent that, make
internal initDbConnWithName to overwrite a connection object, and return
the same object only from initDbConn, which is sort of public interface.

Another solution for this would be to modify initDbConnWithName to
return a connection object and then generate one temporary connection
for each db. It sound feasible but after one attempt it seems it
requires a bit more changes around (init, close connections) and
doesn't bring anything significantly better on the table. In case if
some future changes will prove this wrong, do not hesitate to refactor.

Change retry strategy to more insistive one, namely:

* retry on the next sync even if we failed to process one database and
install pooler appliance.

* perform the whole installation unconditionally on update, since the
list of target databases could be changed.

And for the sake of making it even more robust, also log the case when
operator decides to skip installation.

Extend connection pooler e2e test with verification that all dbs have
required schema installed.
2020-10-19 16:18:58 +02:00
Dmitry Dolgov d15f2d3392
Readiness probe (#1169)
Right now there are no readiness probes defined for connection pooler,
which means after a pod restart there is a short time window (between a
container start and connection pooler starting listening to a socket)
when a service can send queries to a new pod, but connection will be
refused. The pooler container is rather lightweight and it start to
listen immediately, so the time window is small, but still.

To fix this add a readiness probe for tcp socket opened by connection
pooler.
2020-10-15 10:16:42 +02:00
Alex Stockinger 692c721854
Introduce ENABLE_JSON_LOGGING env variable (#1158) 2020-10-08 15:32:15 +02:00
Rafia Sabih d2c410d72b Add labels 2020-10-05 12:10:02 +02:00
Rafia Sabih a6ffdbae36 Cleanup deleteConnectionPooler 2020-10-05 12:06:58 +02:00
Rafia Sabih 86e6a51fa9 Merge branch 'master' into replica-pooler 2020-10-05 11:47:47 +02:00
Sergey Dudoladov 38e15183a2
update kind (#1156)
Co-authored-by: Sergey Dudoladov <sergey.dudoladov@zalando.de>
2020-10-02 09:31:55 +02:00
Felix Kunde 21475f4547
Cleanup config examples (#1151)
* post polishing for latest PRs

* update travis and go modules

* make deprecation comments in structs less confusing

* have separate pod priority class es for operator and database pods
2020-09-30 17:24:14 +02:00
Sergey Dudoladov 3b6dc4f92d
Improve e2e tests (#1111)
* icnrease vm size

* cache deps

* switch to the absolute cache path as cdp does not support shell expansion

* do not pull non-existing image

* manually install kind

* add alias to kind

* use full kind name

* one more name change

* install kind with other tools

* add bind mounts instead of copying files

* test fetching the runner image

* build image for pierone

* bump up the client-go version to match the master

* bump up go version

* install pinned version of kind before any test run

* do not overwrite local ./manifests during test run

* update the docs

* fix kind name

* update go.* files

* fix deps

* avoid unnecessary image upload

* properly install kind

* Change network to host to make it reachable within e2e runner. May not be the right solution though.

* Small changes. Also use entrypoint vs cmd.

* Bumping spilo. Load before test.

* undo incorrect merge from the master

Co-authored-by: Sergey Dudoladov <sergey.dudoladov@zalando.de>
Co-authored-by: Jan Mußler <janm81@gmail.com>
2020-09-25 14:14:19 +02:00
Sergey Dudoladov ffdb47f53a
remove outdated GSOC info (#1148)
Co-authored-by: Sergey Dudoladov <sergey.dudoladov@zalando.de>
2020-09-25 09:46:50 +02:00
Sergey Dudoladov 2a21cc4393
Compare Postgres pod priority on Sync (#1144)
* compare Postgres pod priority on Sync

Co-authored-by: Sergey Dudoladov <sergey.dudoladov@zalando.de>
2020-09-23 17:26:56 +02:00
Rafia Sabih 683cb15b0d Add and update tests 2020-09-23 17:09:36 +02:00
Rafia Sabih 1ee79887cf Add sync test 2020-09-23 11:19:01 +02:00
neelasha-09 ab95eaa6ef
Fixes #1130 (#1139)
* Fixes #1130

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2020-09-22 17:16:05 +02:00
Rafia Sabih 033a7f4e24 Update tests 2020-09-21 22:55:10 +02:00
Rafia Sabih 2936ed0060 Refactor needConnectionPooler
Have one unified function to tell if any connection pooler is required

Add a helper function to list the roles that require connection pooler,
helps in avoiding duplication of code
2020-09-21 16:40:40 +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
Igor Yanchenko d8884a4003
Allow to overwrite default ExternalTrafficPolicy for the service (#1136)
* Allow to overwrite default ExternalTrafficPolicy for the service
2020-09-15 13:19:22 +02:00
Rafia Sabih 7c9b459919 Minor fix 2020-09-11 10:22:29 +02:00
Rafia Sabih 46ff4bb738 Resolve review comments 2020-09-11 10:17:43 +02:00
Rafia Sabih 770fc1e612 Improvements in tests
- Fixed the issue with failing test cases
- Add more test cases for replica connection pooler
- Added docs about the new flag
2020-09-08 17:32:47 +02:00