Commit Graph

716 Commits

Author SHA1 Message Date
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
Dmitrii Dolgov 48ddbc67b5 Limit number of packages and add verbose mode 2018-02-16 16:21:41 +01:00
Dmitrii Dolgov fb5986a2c0 Use travis_wait to prevent timeout 2018-02-16 16:06:33 +01:00
Sergey Dudoladov b1fae716b1 Update REST API to require namespace when fetching info about particular cluster 2018-02-16 15:32:09 +01:00
Sergey Dudoladov e3d2434420 Use '*' as an alias to denote all namespaces 2018-02-16 15:20:26 +01:00
Sergey Dudoladov 088bf70e7d Merge branch 'master' into support-many-namespaces 2018-02-16 15:06:10 +01:00
zerg-junior c09968774b
Merge pull request #238 from zalando-incubator/correctly-select-deployed-ns
Make operator watch its own namespace instead of controller's one
2018-02-16 14:31:54 +01:00
Sergey Dudoladov ec7de38f9b Make operator watch its own namespace instead of controller's one 2018-02-16 14:22:38 +01:00
zerg-junior 7b74da8713
Merge pull request #236 from zalando-incubator/fix-config-map-namespace
Remove the second namespace prefix from the operator configmap name
2018-02-16 12:37:41 +01:00
Sergey Dudoladov b412a831d6 Remove the second namespace prefix from the operator configmap name 2018-02-16 12:30:07 +01:00
zerg-junior 04557922c0
Merge pull request #231 from zalando-incubator/default-to-watched-ns
Operator should default to the watched namespace
2018-02-16 11:45:32 +01:00
Sergey Dudoladov bbe2801d69 Adjust unit tests for namespace decoding 2018-02-16 11:13:08 +01:00
Sergey Dudoladov 0a9e6bd8d2 Clarify when a separate account for database pods may be needed 2018-02-15 16:40:07 +01:00
Sergey Dudoladov 5e9a21456e Remove the incorrect service account check 2018-02-15 16:33:53 +01:00
Sergey Dudoladov 44a2812f5a Update docs to clarify different service accounts 2018-02-15 15:48:35 +01:00
Sergey Dudoladov 155ae8d50f Rename the function that checks service account existence 2018-02-15 11:14:13 +01:00
Sergey Dudoladov fab1e34182 Respond to code review comments 2018-02-15 10:43:06 +01:00
Sergey Dudoladov d5d15b7546 Look for secrets in the deployed namespace 2018-02-14 15:37:30 +01:00
Dmitry Dolgov 00cc81c2e3
Merge pull request #232 from zalando-incubator/feature/add-unit-tests-build-step
Add a new step to run unit tests
2018-02-14 14:59:57 +01:00
Dmitrii Dolgov f6b2135351 Change build id 2018-02-14 14:12:39 +01:00
Dmitrii Dolgov b6ae3e0262 Change build id 2018-02-14 14:11:56 +01:00
Dmitrii Dolgov 7b9428bb81 Switch to the new format 2018-02-14 14:10:48 +01:00
Dmitrii Dolgov d61b87a07d Separate image build & push
Move out some variables on top
2018-02-14 14:07:53 +01:00
Dmitrii Dolgov c21136c151 Forgotten env var 2018-02-14 13:56:35 +01:00
Dmitrii Dolgov eb2283aa43 Change current directory for tests 2018-02-14 13:51:55 +01:00
Dmitrii Dolgov 4513334d1b Change order of the steps 2018-02-14 13:28:16 +01:00