Commit Graph

864 Commits

Author SHA1 Message Date
Felix Kunde f1646c8204 minor changes to docs and manifests 2020-03-05 11:08:50 +01:00
Dmitrii Dolgov 07adaf28cc Extend labels for connection pool 2020-03-05 10:32:20 +01:00
Dmitrii Dolgov a38a5aa574 Add test for sync with flag 2020-03-05 10:12:10 +01:00
Dmitrii Dolgov e0df9dea0c Sync in case of missing deployment
If nothing changed we still need to try to sync and test if the
deployment is there. Otherwise it could be deleted, and operator will
not notice.
2020-03-04 16:07:22 +01:00
Felix Kunde 4d12615c0d reflect new pooler parameter in validation + define same pooler image everywhere 2020-03-04 10:38:01 +01:00
Felix Kunde 2bba673f1d update codegen 2020-03-04 09:36:42 +01:00
Dmitrii Dolgov 918df1461b Add possibility to set max db connections
Since it's an important part of a connection pool configuration, allow
to configure max db connections, that pool will open to a target db.
From this numbers several others (like default pool size, min pool size,
reserve) will be deduced, taking into account desired number of instances.
2020-03-03 15:58:33 +01:00
Dmitrii Dolgov 037d7120ef Sync due to defaults
Since we can miss it while checking only spec
2020-03-02 16:32:15 +01:00
Dmitrii Dolgov 3e98832703 Add more tests
sync logic
system users init
needConnectionPool
2020-02-24 16:20:59 +01:00
Dmitrii Dolgov 619c543b61 E2E tests for connection pool
Turn off enableConnectionPool to be able to test it from the scratch.
Add turn on, modify, turn off/on test.
2020-02-24 14:47:47 +01:00
Felix Kunde cf85db5d7a merge with master and resolve conflict 2020-02-20 10:09:13 +01:00
Felix Kunde 2afaa59719 update code-gen 2020-02-19 15:55:05 +01:00
Felix Kunde 742d7334a1
use cluster-name as default label everywhere (#782)
* use cluster-name as default label everywhere
* fix e2e test
2020-02-19 15:01:01 +01:00
Dmitrii Dolgov 66129335fd Adjust sync logic 2020-02-19 14:53:58 +01:00
Felix Kunde 54796945f6
added pinned werkzeug dep to UI requirements (#835) 2020-02-19 14:19:55 +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 4b440e59de
Fix test flakiness on TestSameService (#833)
The code added on #818 depends on map sorting to return a static reason
for service annotation changes. To avoid tests flakiness and map sorting
the tests include a `strings.HasPrefix` instead of comparing the whole
string. One of the test cases,
`service_removes_a_custom_annotation,_adds_a_new_one_and_change_another`,
is trying to test the whole reason string.

This commit replaces the test case reason, for only the reason prefix.
It removes the flakiness from the tests. As all the cases (annotation
adding, removing and value changing) are tested before, it's safe to
test only prefixes.

Also, it renames the test name from `TestServiceAnnotations` to
`TestSameService` and introduces a better description in case of test
failure, describing that only prefixes are tested.
2020-02-18 16:45:44 +01:00
Dmitrii Dolgov 97217e27ed Delete if a new specification is nil
Use coalesce for username too.
2020-02-17 15:34:10 +01:00
Dmitrii Dolgov 35d82e5a17 Do sync also when there are no deployment 2020-02-17 14:28:38 +01:00
Dmitrii Dolgov 4add317b48 Merge branch 'master' into feature/connection-pooler 2020-02-17 13:11:57 +01:00
Dmitrii Dolgov 515bb2dfad Address review, add ConnectionPool init for sync 2020-02-17 13:07:40 +01:00
Felix Kunde 702a194c41
switch to rbac/v1 (#829)
* switch to rbac/v1
2020-02-17 11:25:07 +01:00
Dmitrii Dolgov a9d02bacc4 Address review 2020-02-14 14:20:35 +01:00
Dmitrii Dolgov 0095be0279 Fix uninitialized ConnectionPool structure usage
It's being used quite early to setup a connection pool user, and if only
enableConnectionPool specified, can be nil.
2020-02-14 13:04:24 +01:00
Dmitrii Dolgov 447a659d6d Report status in e2e 2020-02-14 11:49:48 +01:00
Dmitrii Dolgov 898d441ff2 And output the resulting completed process 2020-02-13 17:26:24 +01:00
Dmitrii Dolgov 8a81bc7464 Capture output for debugging purposes 2020-02-13 17:03:59 +01:00
Dmitrii Dolgov e11f787664 Rename replicas to avoid potential confusion about terminology 2020-02-13 16:34:02 +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
Dmitrii Dolgov e2664843ba Add a real pgbouncer image 2020-02-13 15:22:40 +01:00
Felix Kunde 6ddac2f9d6 update codegen 2020-02-13 14:51:43 +01:00
Felix Kunde 4f2457bbe8 clean up merge conflict 2020-02-13 14:19:15 +01:00
Felix Kunde 99f2b038b5 add enableConnectionPool to validation and some nior fixes 2020-02-13 14:15:57 +01:00
Felix Kunde c9a1c8e6b4 add enableConnectionPool to validation and some nior fixes 2020-02-13 14:13:06 +01:00
Dmitrii Dolgov 2384e1ec10 Cleanup configuration
Add pool configuration into CRD & charts. Add preliminary documentation.
Rename NumberOfInstances to Replicas like in Deployment. Mention couple
of potential improvement points for connection pool specification.
2020-02-13 13:47:19 +01:00
Felix Kunde f0ceafa81e reflect connectionPool validation in Go code and publish in manifests and chart 2020-02-13 13:47:19 +01:00
Felix Kunde 17d077e370 add validation for postgresql CRD 2020-02-13 13:47:19 +01:00
Dmitrii Dolgov 82e9d40587 Add test for both ways to enable connection pool 2020-02-13 13:47:19 +01:00
Dmitrii Dolgov 3ff1147bce Various improvements
Add synchronization logic. For now get rid of podTemplate, type fields.
Add crd validation & configuration part, put retry on top of lookup
function installation.
2020-02-13 13:47:19 +01:00
Dmitrii Dolgov 8bd2086cd2 Add more tests 2020-02-13 13:47:18 +01:00
Dmitrii Dolgov 7254039f2e Add CRD configuration
With convertion for config, and start tests.
2020-02-13 13:42:28 +01:00
Dmitrii Dolgov c028be493f Improve cleaning up
Set up a proper owner reference to StatefulSet, and delete with
foreground policy to not leave orphans.
2020-02-13 13:42:28 +01:00
Dmitrii Dolgov be438b77e6 WIP Connection pooler support
Add an initial support for a connection pooler. The idea is to make it
generic enough to be able to switch a corresponding docker image to
change from pgbouncer to e.g. odyssey. Operator needs to create a
deployment with pooler and a service for it to access.
2020-02-13 13:42:28 +01:00
Dmitrii Dolgov 6dad83325b Cleanup configuration
Add pool configuration into CRD & charts. Add preliminary documentation.
Rename NumberOfInstances to Replicas like in Deployment. Mention couple
of potential improvement points for connection pool specification.
2020-02-13 13:36:14 +01:00
Felix Kunde f2c9905123 reflect connectionPool validation in Go code and publish in manifests and chart 2020-02-13 12:54:32 +01:00
Felix Kunde b66b1633a1 add validation for postgresql CRD 2020-02-13 11:56:05 +01:00
Dmitrii Dolgov 55873f06be Add test for both ways to enable connection pool 2020-02-13 11:04:11 +01:00
Jonathan Juares Beber 744c71d16b
Allow services update when changing annotations (#818)
The current implementations for `pkg.util.k8sutil.SameService` considers
only service annotations change on the default annotations created by the
operator. Custom annotations are not compared and consequently not
applied after the first service creation.

This commit introduces a complete annotations comparison between the
current service created by the operator and the new one generated based on
the configs. Also, it adds tests on the above-mentioned function.
2020-02-13 10:55:30 +01:00
Dmitrii Dolgov 6c3752068b Various improvements
Add synchronization logic. For now get rid of podTemplate, type fields.
Add crd validation & configuration part, put retry on top of lookup
function installation.
2020-02-12 17:35:43 +01:00