Commit Graph

542 Commits

Author SHA1 Message Date
Dmitrii Dolgov 9f51d7377b Use connection pool labels 2020-03-24 16:30:21 +01:00
Felix Kunde 21af41025a lower CPU request and update docs 2020-03-20 17:26:33 +01:00
Felix Kunde b0f534776d update pooler default image and add explanation for maxDBConnections param 2020-03-20 15:56:27 +01:00
Felix Kunde 0aff65ee6f fix typo 2020-03-20 11:33:33 +01:00
Felix Kunde 1ca8028fa5 use min instances 2 everywhere and update reference docs 2020-03-20 11:31:49 +01:00
Dmitrii Dolgov 7a9d898af7 Set min number of instances to 2 2020-03-20 09:46:00 +01:00
Dmitrii Dolgov f839806616 Address feedback
Set default numberOfInstances to 2. Add verifications for config. Fix
schema/user typos. Avoid closing an empty connections.
2020-03-19 16:56:04 +01:00
Dmitrii Dolgov 6ae3c3d752 Adjust default resource configuration
Since connection poolers are usually cpu bounded.
2020-03-19 12:09:41 +01:00
Dmitrii Dolgov 20b2fb4642 Defaults for user/schema fix
Verify the defaul values only if the schema doesn't override them.
2020-03-19 11:28:39 +01:00
Dmitrii Dolgov 48cdbb6a65 Minor improvements
* Set minimum number of pool instances to 2
* Improve logging of sync reasons
* Improve logging of a new pool role
2020-03-19 10:31:58 +01:00
Dmitrii Dolgov 1c7065e4ce Address feedback
Rename application for connection pool (ideally in the future make it
configurable). Take into accounts nils for MaxInt32
2020-03-17 11:33:56 +01:00
Dmitrii Dolgov cf6541b8cf Address feedback
Small typo-like fixes and proper installing of a lookup function in all
the databases.
2020-03-17 11:12:29 +01:00
Dmitrii Dolgov 4d61adf6b7 Merge branch 'master' into feature/connection-pooler 2020-03-16 12:07:56 +01:00
Dmitrii Dolgov 6d1a1ea22c Fix role sync if default pool user/schema changed
It requires more accurate lookup function synchronization and couple
fixes on the way (e.g. few get rid of using schema from a user secret).
For lookup function, since it's idempotend, sync it when we're not sure
if it was installed (e.g. when the operator was shutdown and start sync
everything at the start) and then remember that it was installed.
2020-03-13 14:34:54 +01:00
Dmitry Dolgov d666c52172
ClusterDomain default (#863)
* add json:omitempty option to ClusterDomain

* Add default value for ClusterDomain

Unfortunately, omitempty in operator configuration CRD doesn't mean that
defauls from operator config object will be picked up automatically.
Make sure that ClusterDomain default is specified, so that even when
someone will set cluster_domain = "", it will be overwritted with a
default value.

Co-authored-by: mlu42 <mlu42pro@gmail.com>
2020-03-13 11:51:39 +01:00
Felix Kunde b66734a0a9
omit PgVersion diff on sync (#860)
* use PostgresParam.PgVersion everywhere
* on sync compare pgVersion with SpiloConfiguration
* update getNewPgVersion and added tests
2020-03-13 11:48:19 +01:00
zimbatm 65fb2ce1a6
add support for custom TLS certificates (#798)
* add support for custom TLS certificates
2020-03-13 11:44:38 +01:00
grantlanglois 650b8daf77
add json:omitempty option to ClusterDomain (#851)
Co-authored-by: mlu42 <mlu42pro@gmail.com>
2020-03-12 12:12:53 +01:00
Dmitrii Dolgov c0a840c3ed Sync other way around 2020-03-09 14:05:04 +01:00
Dmitrii Dolgov 2e023799e1 Fix tests
To have necessary number of replicas set
2020-03-06 14:35:31 +01:00
Dmitrii Dolgov e6f1e8b7fc Merge branch 'master' into feature/connection-pooler 2020-03-06 13:40:15 +01:00
Dmitrii Dolgov 80fee17ea4 Various fixes
Sync pool user correctly, without overriding it.
Fix numberOfInstances comparison in defaults.
Fix maxDBConnections usage.
2020-03-06 13:32:04 +01:00
Felix Kunde ae2a38d62a
add e2e test for node readiness label (#846)
* add e2e test for node readiness label
* refactoring and order tests alphabetically
* always wait for replica after failover
2020-03-06 12:55:34 +01:00
Dmitrii Dolgov ab118dd78b Prevent operator from wrongly syncing pooler user 2020-03-05 17:31:04 +01:00
Dmitrii Dolgov e645ca5c23 Prevent original labels from update 2020-03-05 14:36:13 +01:00
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
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
Dmitrii Dolgov 3e98832703 Add more tests
sync logic
system users init
needConnectionPool
2020-02-24 16:20:59 +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 7b94060d17
fix validation for S3ForcePathStyle (#841) 2020-02-21 16:36:23 +01:00
Felix Kunde e2a9b03913
bump spilo version to latest release (#836) 2020-02-20 16:21:21 +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 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