Commit Graph

545 Commits

Author SHA1 Message Date
Sergey Dudoladov 83a26fb78b Rename RBAC file 2018-05-17 12:05:31 +02:00
Sergey Dudoladov 08919fed57 Fix links and typos 2018-05-17 10:56:54 +02:00
Sergey Dudoladov bfc1950df8 Shorten the introduction 2018-05-16 17:25:03 +02:00
Sergey Dudoladov 631748cd59 Simplify layout 2018-05-16 16:10:49 +02:00
Sergey Dudoladov b067ec788a Minor edits 2018-05-16 16:01:16 +02:00
Sergey Dudoladov a926515530 Employ RBAC when run on minikube 2018-05-16 15:28:45 +02:00
Sergey Dudoladov ca8542185a Add RBAC to Quickstart guide 2018-05-16 11:01:16 +02:00
Sergey Dudoladov 9575c9d35e Create Quickstart section for the docs 2018-05-15 17:39:47 +02:00
zerg-junior 545d5d92ff
Merge pull request #285 from zalando-incubator/readme-changes-1
README and deployment manifest updates
2018-05-14 10:40:40 +02:00
Oleksii Kliukin 40163677c7
Remove Kubernetes upgrade-related labels
The node_eol_label is obsolete and not used.

The node_readiness_label, if set, will prevent scheduling pods on the node without that label, by default minikube doesn't set any label on the node.
2018-05-08 15:50:10 +02:00
Oleksii Kliukin 288242d021
Change rolling upgrades to rolling updates.
Terminology change.
2018-05-08 15:45:01 +02:00
Jan M 2bb3bdeeb4 Slimming out README and config map, targeting easy first time deployers to minicube. 2018-05-04 12:20:54 +02:00
Oleksii Kliukin 4c8dfd7e20
Remove the check for the clone cluster name. (#270)
* Sanity checks for the cluster name, improve tests.

- check that the normal and clone cluster name complies with the valid
  service name. For clone cluster, only do it if clone timestamp is not
  set; with a clone timestamp set, the clone name points to the S3 bucket

 - add tests and improve existing ones, making sure we don't call Error()
   method for an empty error, as well as that we don't miss cases where
   expected error is not empty, but actual call to be tested does not
   return an error.

Code review by @zerg-junior and @Jan-M
2018-05-03 10:21:37 +02:00
Oleksii Kliukin fe47f9ebea
Improve the pod moving behavior during the Kubernetes cluster upgrade. (#281)
* Improve the pod moving behavior during the Kubernetes cluster upgrade.

Fix an issue of not waiting for at least one replica to become ready
(if the Statefulset indicates there are replicas) when moving the master
pod off the decomissioned node. Resolves the first part of #279.

Small fixes to error messages.

* Eliminate a race condition during the swithover.

When the operator initiates the failover (switchover) that fails and
then retries it for a second time it may happen that the previous
waitForPodChannel is still active. As a result, the operator subscribes
to the former master pod two times, causing a panic.

The problem was that the original code didn't bother to cancel the
waitForPodLalbel for the new master pod in the case when the failover
fails. This commit fixes it by adding a stop channel to that function.

Code review by @zerg-junior
2018-05-03 10:20:24 +02:00
zerg-junior ebff820fcc
Merge pull request #284 from zalando-incubator/ship-pg-daily-log-to-s3
Set up an S3 bucket for the postgres logs
2018-05-02 14:39:03 +02:00
Sergey Dudoladov 59ded0c212 Shorten bucket name 2018-05-02 14:05:57 +02:00
Sergey Dudoladov c45219bafa Set up an S3 bucket for the postgres daily logs 2018-05-02 12:52:42 +02:00
Oleksii Kliukin 4a3ccad362
Merge pull request #282 from zalando-incubator/assign_existing_service_definition_during_sync
Fix a bug with syncing services
2018-04-27 13:49:40 +02:00
Oleksii Kliukin 37caa3f60b Fix a bug with syncing services
Avoid showing "there is no service in the cluster" when syncing a
service for the cluster if the operator has been restarted after
the cluster had been created.
2018-04-27 12:35:25 +02:00
zerg-junior 8f08bef67c
Merge pull request #277 from zalando-incubator/automatically-deploy-service-account
Deploy service account for pod creation on demand
2018-04-26 14:44:37 +02:00
Sergey Dudoladov 1b718fd4c2 Minor improvemets in reporting service account creation 2018-04-26 13:47:25 +02:00
Sergey Dudoladov 4255e702bc Always empty account's namespace after parsing 2018-04-25 13:57:24 +02:00
Sergey Dudoladov d99b553ec1 Convert default account definiton into JSON 2018-04-25 12:35:16 +02:00
Sergey Dudoladov e3f7fac443 Comment on the default value for pod service account name 2018-04-24 15:41:28 +02:00
Sergey Dudoladov 3d0ab40d64 Explicitly warn on account name mismatch 2018-04-24 15:31:22 +02:00
Sergey Dudoladov 485ec4b8ea Move service account to Controller 2018-04-24 15:13:08 +02:00
zerg-junior 5d5b48fa20
Merge pull request #278 from zalando-incubator/tolerate-team-service-issues
Tolerate issues of the Teams API
2018-04-24 13:54:46 +02:00
Sergey Dudoladov bc8b950da4 Tolerate issues of the Teams API 2018-04-23 16:31:53 +02:00
Sergey Dudoladov c31c76281c Make operator unaware of its own service account 2018-04-23 14:38:20 +02:00
Sergey Dudoladov a88416e6ea Include default service account for pods into README.md 2018-04-23 14:28:00 +02:00
Sergey Dudoladov 5daf0a4172 Fix error reporting during pod service account creation 2018-04-20 14:20:38 +02:00
Sergey Dudoladov bd51d2922b Turn ServiceAccount into struct value to avoid race conditon during account creation 2018-04-20 13:05:05 +02:00
Sergey Dudoladov a5a65e93f4 Name service account consistenly 2018-04-19 16:15:52 +02:00
Sergey Dudoladov 2f3d63a663 Document desired behaviour 2018-04-19 16:11:34 +02:00
Sergey Dudoladov 23f893647c Remove sync of pod service accounts 2018-04-19 15:48:58 +02:00
Sergey Dudoladov 214ae04aa7 Deploy service account for pod creation on demand 2018-04-18 16:20:20 +02:00
Manuel Gómez 5e1d86e31e
Fix clone timestamp key in example manifest (#276)
It was set to `endTimestamp`, but it should be `timestamp`.
2018-04-16 18:23:41 +02:00
Manuel Gómez 88c68712b6
Fix statefulset label selector diffing (#273)
Otherwise, rolling updates are done unnecessarily.
2018-04-06 17:21:57 +02:00
Oleksii Kliukin 9bf80afa6b
Remove team from statefulset selector (#271)
* Remove 'team' label from the statefulset selector.

I was never supposed to be there, but implicitely statefulset
creates a selector out of meta.labels field. That is the problem
with recent Kubernetes, since statefulset cannot pick up pods
with non-matching label selectors, and we rely on statefulset
picking up old pods after statefulset replacement.

Make sure selector changes trigger replacement of the statefulset.

In the case new selector has more labels than the old one nothing
should be done with a statefulset, otherwise the new statefulset
won't see orphaned pods from the old one, as they won't match the
selector. 

See https://github.com/kubernetes/kubernetes/issues/46901#issuecomment-356418393
2018-04-06 13:58:47 +02:00
Oleksii Kliukin c44cd9e4e6
Define the operator RBAC (#234)
Note that the account here is named zalando-postgres-operator and not
the 'operator' default that is created in the serviceaccount.yaml and
also used by the operator configmap to create new postgres clusters.

This is done intentionally, as to avoid breaking those setups that
already work. Ideally, the operator should be run under the
zalando-postgres-operator service account. However, the service account
used to run Postgres clusters does not require all those privileges and
is described at
https://github.com/zalando/patroni/blob/master/kubernetes/patroni_k8s.yaml

The service account defined here acquires some privileges not really
used by the operator (i.e. we only need list and watch on configmaps),
this is also done intentionally to avoid breaking things if someone
decides to configure the same service account in the operator's
configmap to run postgres clusters.

Documentation and further testing by @zerg-junior
2018-04-05 11:24:24 +02:00
Oleksii Kliukin 26db91c53e
Improve infrastructure role definitions (#208)
Enhance definitions of infrastructure roles by allowing membership in multiple roles, role options and per-role configuration to be specified in the infrastructure role configmap, which must have the same name as the infrastructure role secret. See manifests/infrastructure-roles-configmap.yaml for the examples and updated README for the description of different types of database roles supposed by the operator and their purposes.

Change the logic of merging infrastructure roles with the manifest roles when they have the same name, to return the infrastructure role unchanged instead of merging. Previously, we used to propagate flags from the manifest role to the resulting infrastructure one, as there were no way to define flags for the infrastructure role; however, this is not the case anymore.

Code review and tests by @erthalion
2018-04-04 17:21:36 +02:00
zerg-junior d264be9faa
Merge pull request #261 from zalando-incubator/wal_bucket_scope_prefix
Fix clone for origins in non-default namespaces.
2018-04-03 17:47:18 +02:00
zerg-junior ff5793b584
Merge pull request #258 from zalando-incubator/always-create-replica-service
[WIP] Always create replica service
2018-03-29 14:42:26 +02:00
Sergey Dudoladov edf710d772 Add tests for load balancer function logic by Dmitrii Dolgov 2018-03-27 16:10:57 +02:00
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
Dmitry Dolgov 5200579a89
Merge pull request #267 from zalando-incubator/scope-operator
Add scope section to readme.
2018-03-27 10:35:14 +02:00
Sergey Dudoladov 96d46252f5 Change the default values to closer match previous behaviour 2018-03-26 11:43: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