Commit Graph

491 Commits

Author SHA1 Message Date
erthalion 34518a4eb0 Some fixes for travis ci and cdp
remove cmd package from travis (it's complaining because
there are no tests), and add apt-get update for cdp.
2018-03-27 16:05:13 +02:00
erthalion 8967a3be2c Add tests for load balancer function logic 2018-03-27 12:11:46 +02:00
Sergey Dudoladov ced770a827 Respond to code review 2018-03-26 11:07:32 +02:00
Sergey Dudoladov a8862aeee1 Enable backward compatibility for enable_load_balancer setting from operator configmap 2018-03-19 17:19:50 +01:00
Sergey Dudoladov 931b48fcbb Respond to code reviews 2018-03-16 15:36:42 +01:00
Sergey Dudoladov 386d7b6bdb Implement backward compatibility with older load balancer settings 2018-03-16 13:27:38 +01:00
Sergey Dudoladov 145689c950 Disable load balancer for master service by default (it may cost money) 2018-03-16 13:18:13 +01:00
Sergey Dudoladov 27837e5672 Document usage of load balancers 2018-03-14 13:09:16 +01:00
Sergey Dudoladov 20f30d3739 Update the method for deciding about load balancers 2018-03-14 12:46:58 +01:00
Sergey Dudoladov 0986e56226 Add separate params for master and replica load balancers to operator configuration 2018-03-14 12:12:28 +01:00
Sergey Dudoladov ac6c5bcf09 Explicitly name replica and master load balancer params in PostgresSpec 2018-03-14 12:03:27 +01:00
Sergey Dudoladov 5bc5e70c81 Log if replica service has no load balancer 2018-03-12 16:48:44 +01:00
Sergey Dudoladov 5ff562a607 Minor improvements 2018-03-02 14:03:41 +01:00
Sergey Dudoladov 2aeff096f7 Make ReplicaLoadBalancer a separate toggler 2018-03-02 13:35:25 +01:00
Sergey Dudoladov 18741750f5 Make ReplicaLoadBalancer a pointer to handle the case when it is unset 2018-03-02 12:00:02 +01:00
Sergey Dudoladov e74c05fec9 Document intended usage of useLoadBalancer 2018-03-02 11:47:51 +01:00
Sergey Dudoladov fb21246fcd Remove early stopping conditions that rely on the relica service being absent 2018-02-27 17:21:51 +01:00
Sergey Dudoladov 28fed26845 Do not delete an endpoint for the replica service w/o load balancer during sync 2018-02-27 17:18:30 +01:00
Sergey Dudoladov b107d781e8 Do not delete replica service w/o load balancer during sync 2018-02-27 17:16:00 +01:00
Sergey Dudoladov 2ef069ee93 Create/delete replica service regardless of load balancer setup 2018-02-27 17:10:49 +01:00
Jan Mussler cb55749c1b
Update postgres-operator.yaml (#255)
Bump operator image version.
2018-02-26 20:03:56 +01:00
zerg-junior 0f392c2007
Merge pull request #252 from zalando-incubator/label-teams
Add 'team' label to pods, stateful sets, secrets and pod disruption budgets
2018-02-26 12:57:26 +01:00
Sergey Dudoladov 071547e5bf Modify to add extra labels only during resource creation 2018-02-26 11:11:50 +01:00
Oleksii Kliukin 2bb7e98268
update individual role secrets from infrastructure roles (#206)
* Track origin of roles.

* Propagate changes on infrastructure roles to corresponding secrets.

When the password in the infrastructure role is updated, re-generate the
secret for that role.

Previously, the password for an infrastructure role was always fetched from
the secret, making any updates to such role a no-op after the corresponding
secret had been generated.
2018-02-23 17:24:04 +01:00
Sergey Dudoladov 00dc810544 Add 'team' label to pods, stateful sets, secrets and pod disruption budgets 2018-02-23 14:36:10 +01:00
Dmitry Dolgov 7b05758893
Merge pull request #251 from zalando-incubator/feature/refactor-compare-containers
Move container comparison logic to a separate function
2018-02-23 14:32:55 +01:00
Dmitrii Dolgov ef50b147c5 Use list of checks instead of a map 2018-02-23 14:24:33 +01:00
Dmitrii Dolgov 95d86c7600 Move container comparison logic to a separate function 2018-02-23 11:58:37 +01:00
Oleksii Kliukin c4aab502b3
Remove Patroni leftover objects on cluster deletion. (#244)
* Remove all endpoints and configmaps from Patroni when Patroni is running with Kubernetes support on cluster deletion.
2018-02-23 09:52:22 +01:00
zerg-junior 6a29bbbcfa
Merge pull request #250 from zalando-incubator/show_warning_on_cluster_list_unmarshal
Make errors in the cluster list function visible.
2018-02-22 20:53:25 +01:00
Oleksii Kliukin f18bb6eaaa Make errors in the cluster list function visible.
Sometimes the operator does not pick up clusters right away when
they are created. The change attempts to shed light on the
reason behind that.
2018-02-22 16:45:10 +01:00
zerg-junior 65ef1da715
Merge pull request #249 from zalando-incubator/zerg-junior-patch-2
Update README.md
2018-02-22 15:03:00 +01:00
zerg-junior 2782e948e1
Update README.md 2018-02-22 12:17:04 +01:00
zerg-junior 8262822c5f
Merge pull request #247 from zalando-incubator/doc-unaccessible-ns
Document behavior in the case of unaccessible namespaces
2018-02-22 11:55:46 +01:00
Dmitry Dolgov bf4b0f0f33
Merge pull request #240 from zalando-incubator/feature/goreport-improvements
Some improvements for golint, ineffassign and misspell
2018-02-22 11:31:08 +01:00
Sergey Dudoladov 50331bc50a Document behavior in the case of unaccessible namespaces 2018-02-22 11:31:08 +01:00
Oleksii Kliukin cca73e30b7
Make code around recreating pods and creating objects in the database less brittle (#213)
There used to be a masterLess flag that was supposed to indicate whether the cluster it belongs to runs without the acting master by design. At some point, as we didn't really have support for such clusters, the flag has been misused to indicate there is no master in the cluster. However, that was not done consistently (a cluster without all pods running would never be masterless, even when the master is not among the running pods) and it was based on the wrong assumption that the masterless cluster will remain masterless until the next attempt to change that flag, ignoring the possibility of master coming up or some node doing a successful promotion. Therefore, this PR gets rid of that flag completely.

When the cluster is running with 0 instances, there is obviously no master and it makes no sense to create any database objects inside the non-existing master. Therefore, this PR introduces an additional check for that.

recreatePods were assuming that the roles of the pods recorded when the function has stared will not change; for instance, terminated replica pods should start as replicas. Revisit that assumption by looking at the actual role of the re-spawned pods; that avoids a failover if some replica has promoted to the master role while being re-spawned. In addition, if the failover from the old master was unsuccessful, we used to stop and leave the old master running on an old pod, without recording this fact anywhere. This PR makes the failover failure emit a warning, but not stop recreating the last master pod; in the worst case, the running master will be terminated, however, this case is rather unlikely one.

As a side effect, make waitForPodLabel return the pod definition it waited for, avoiding extra API calls in recreatePods and movePodFromEndOfLifeNode
2018-02-22 10:42:05 +01:00
Oleksii Kliukin 8801e62b12 Make sure the result of /clusters is returned to the user. 2018-02-22 10:21:09 +01:00
Oleksii Kliukin 85f7c944c2 Improve the condition check. 2018-02-22 10:13:46 +01:00
Oleksii Kliukin 1f71c8d72f
Avoid reading the namespace file every time the NamespacedName value is decoded. (#243) 2018-02-20 17:41:11 +01:00
zerg-junior b0549c3c9c
Merge pull request #225 from zalando-incubator/support-many-namespaces
Support many namespaces
2018-02-20 17:39:42 +01:00
Sergey Dudoladov e048328d6a Comment on special values for watched namespace 2018-02-20 17:26:17 +01:00
Oleksii Kliukin 99c090899f
Change the suffix delimiter to slash. (#242)
This allows using S3 API in order to simplify finding all folders that are different only by a suffix, since the suffix delimiter will not occur in the suffix itself (currently being a UID).
2018-02-20 16:31:44 +01:00
Sergey Dudoladov 66a3b6830e Call fatalf if namespace to watch does not exist 2018-02-20 16:13:48 +01:00
Oleksii Kliukin c597377617
Use cluster UID as a suffix to the WAL bucket. (#211)
Avoid reusing WAL S3 buckets of the older cluster with the same name as the existing one.

For the new cluster, the S3 bucket name will include a suffix that is equal to the UID of the PostgreSQL object describing the cluster. That way, the bucket name will stay the same for all members iff  they correspond to the same PostgreSQL cluster object.

When "clone: uid:" key is present in the cluster manifest and the cluster is cloned from an S3 bucket (currently that happens if the endTimestamp is present in the clone description) the S3 bucket to clone from is suffixed with the -uid value.
2018-02-20 15:36:43 +01:00
Sergey Dudoladov c47abed6ba Document usage of multiple namespaces 2018-02-20 14:51:18 +01:00
Sergey Dudoladov dcfc9925f6 Respond to code review 2018-02-20 14:43:02 +01:00
Dmitrii Dolgov a7cd859919 Some improvements for golint, ineffassign and misspell 2018-02-19 17:46:31 +01:00
Dmitry Dolgov 0e3f941d2f
Merge pull request #239 from zalando-incubator/feature/travis-timeout
WIP: Use travis_wait to prevent timeout
2018-02-16 16:40:15 +01:00
Dmitrii Dolgov 00a405b94e Limit number of commits builded by travic 2018-02-16 16:25:50 +01:00