Commit Graph

229 Commits

Author SHA1 Message Date
Murat Kabilov 307708435b Merge branch 'master' into feature/tests
# Conflicts:
#	pkg/cluster/k8sres.go
#	pkg/spec/types.go
2017-07-13 17:06:53 +02:00
Murat Kabilov ea0ed11e86 move cluster config struct to the spec package 2017-07-13 16:51:41 +02:00
Murat Kabilov 333dfdd640 introduce Cluster interface 2017-07-13 15:26:22 +02:00
Oleksii Kliukin a8ed1e25b4 Avoid re-creating master pod if it is empty during sync. (#58)
Fixes #59
2017-07-12 10:57:20 +02:00
Oleksii Kliukin 00150711e4 Configure load balancer on a per-cluster and operator-wide level (#57)
* Deny all requests to the load balancer by default.
* Operator-wide toggle for the load-balancer.
* Define per-cluster useLoadBalancer option.

If useLoadBalancer is not set - then operator-wide defaults take place. If it
is true - the load balancer is created, otherwise a service type clusterIP is
created.

Internally, we have to completely replace the service if the service type
changes. We cannot patch, since some fields from the old service that will
remain after patch are incompatible with the new one, and handling them
explicitly when updating the service is ugly and error-prone. We cannot
update the service because of the immutable fields, that leaves us the only
option of deleting the old service and creating the new one. Unfortunately,
there is still an issue of unnecessary removal of endpoints associated with
the service, it will be addressed in future commits.

* Revert the unintended effect of go fmt

* Recreate endpoints on service update.

When the service type is changed, the service is deleted and then
the one with the new type is created. Unfortnately, endpoints are
deleted as well. Re-create them afterwards, preserving the original
addresses stored in them.

* Improve error messages and comments. Use generate instead of gen in names.
2017-06-30 13:38:49 +02:00
Oleksii Kliukin ba6529bec9 Avoid pushing postgres-operator image on PRs. (#52)
Do push as postgres-operator from the master branch, and as a
postgres-operator-test when evaluating pull-requests.
2017-06-14 14:56:04 +02:00
Oleksii Kliukin 2f5a349477 CDP integration (#51)
Build docker images from the master branch via CDP and push them to the registry.opensource.zalan.do
2017-06-13 18:12:04 +02:00
Oleksii Kliukin fe6c162e59 Add a few badges (#50)
#6
2017-06-12 18:10:23 +02:00
Oleksii Kliukin 0de1537c4e Travis CI (#49) 2017-06-12 17:39:41 +02:00
Murat Kabilov 9a6b0b8c37 Tests for teams API (#46) 2017-06-12 17:29:32 +02:00
Oleksii Kliukin c773a4e43d A bare bones .travis.yml (#48) 2017-06-12 16:31:25 +02:00
Oleksii Kliukin 987990fb0e Move service annotation patch template into the constants. 2017-06-12 10:24:23 +02:00
Oleksii Kliukin 17826ee434 Go fmt run. 2017-06-12 10:24:23 +02:00
Oleksii Kliukin 51d73fb172 Replace service annotations when updating services.
In case the whole annotation changes (like the external DNS) we
don't want to keep the old one hanging around. Unline specs, we
don't expect anyone except the operator to change the annotations.

Use StrategicMergePatchType in order to replace the annotations
map completely.
2017-06-12 10:24:23 +02:00
Murat Kabilov 4ec4c71d27 remove unnecessary code 2017-06-09 11:40:21 +02:00
Murat Kabilov 18e4084fab remove unnecessary code 2017-06-09 11:39:49 +02:00
Murat Kabilov a198442338 Merge branch 'master' into feature/tests
# Conflicts:
#	pkg/util/teams/teams.go
2017-06-09 11:35:20 +02:00
Murat Kabilov 7d1c7924f2 test http client close 2017-06-09 11:34:08 +02:00
Oleksii Kliukin e0dacd0ca9 Remove an unused export. 2017-06-08 16:17:01 +02:00
Murat Kabilov a9d746878b fix golint warn 2017-06-08 15:52:01 +02:00
Murat Kabilov 1540a2ba65 fix typos;
remove unnecessary tests;
go fmt -s
2017-06-08 15:52:01 +02:00
Murat Kabilov 80038239f7 Merge remote-tracking branch 'origin/feature/tests' into feature/tests 2017-06-08 15:18:57 +02:00
Murat Kabilov 736e8e1bde fix NamespacedName decoder 2017-06-08 15:18:09 +02:00
Murat Kabilov e104a67260 Fix resync of the clusters 2017-06-08 11:51:48 +02:00
Murat Kabilov bdc2db97ac Tests for Specs and Teams API 2017-06-08 10:58:48 +02:00
Oleksii Kliukin bc0e9ab4bc Add error checks per report from errcheck-ng 2017-06-08 10:41:44 +02:00
Murat Kabilov 292a9bda05 Check for dns annotation of the service 2017-06-07 16:41:39 +02:00
Oleksii Kliukin dc36c4ca12 Implement replicaLoadBalancer boolean flag. (#38)
The flag adds a replica service with the name cluster_name-repl and
a DNS name that defaults to {cluster}-repl.{team}.{hostedzone}.

The implementation converted Service field of the cluster into a map
with one or two elements and deals with the cases when the new flag
is changed on a running cluster
(the update and the sync should create or delete the replica service).
In order to pick up master and replica service and master endpoint
when listing cluster resources.

* Update the spec when updating the cluster.
2017-06-07 13:54:17 +02:00
Murat Kabilov c8d80273c3 Merge branch 'master' into feature/tests 2017-06-06 16:02:27 +02:00
Murat Kabilov 9086beaa40 Merge branch 'master' into feature/tests
# Conflicts:
#	pkg/spec/postgresql.go
2017-06-06 14:56:59 +02:00
Oleksii Kliukin 7b0ca31bfb Implements EBS volume resizing #35.
In order to support volumes different from EBS and filesystems other than EXT2/3/4 the respective code parts were implemented as interfaces. Adding the new resize for the volume or the filesystem will require implementing the interface, but no other changes in the cluster code itself.

Volume resizing first changes the EBS and the filesystem, and only afterwards is reflected in the Kubernetes "PersistentVolume" object. This is done deliberately to be able to check if the volume needs resizing by peeking at the Size of the PersistentVolume structure. We recheck, nevertheless, in the EBSVolumeResizer, whether the actual EBS volume size doesn't match the spec, since call to the AWS ModifyVolume is counted against the resize limit of once every 6 hours, even for those calls that shouldn't result in an actual resize (i.e. when the size matches the one for the running volume).

As a collateral, split the constants into multiple files, move the volume code into a separate file and fix minor issues related to the error reporting.
2017-06-06 13:53:27 +02:00
Murat Kabilov 1fb05212a9 Refactor teams API package 2017-05-30 10:14:30 +02:00
Murat Kabilov f7aaf8863d Change maintenance window format 2017-05-30 09:56:10 +02:00
Murat Kabilov 41b774c004 fix postgresql spec tests 2017-05-29 18:08:55 +02:00
Murat Kabilov 312f9e47b3 postgresql spec tests 2017-05-29 16:51:40 +02:00
Murat Kabilov d39cfaab43 Fix password check in pguserpassword function 2017-05-29 13:44:30 +02:00
Murat Kabilov fdde527e82 simplify bytes check 2017-05-26 18:34:05 +02:00
Murat Kabilov 3ab8537b8b util test 2017-05-26 18:21:17 +02:00
Murat Kabilov 1111964fee fix password check in pguserpassword
remove magic number
2017-05-26 18:19:12 +02:00
Murat Kabilov a576d29017 Merge branch 'fix/maintenancewindow-parsing' into feature/tests
# Conflicts:
#	pkg/spec/postgresql.go
2017-05-26 17:15:09 +02:00
Murat Kabilov a21a16d24c better naming
fix function visibility
2017-05-26 17:12:32 +02:00
Murat Kabilov 8e1c21c396 fix maintenance window parsing 2017-05-26 17:09:12 +02:00
Murat Kabilov 54fe4b530e postgresql tests 2017-05-26 16:53:28 +02:00
Murat Kabilov 1708f7b8e0 postgresql tests 2017-05-26 12:44:44 +02:00
Murat Kabilov 0bfb81eb4f postgresql spec status fields omit empty 2017-05-26 12:43:30 +02:00
Murat Kabilov ac92696d3b go fmt 2017-05-24 18:39:04 +02:00
Murat Kabilov 20e343ebc9 namespacedname decoder tests 2017-05-24 18:38:56 +02:00
Murat Kabilov 295b00b379 postgresql spec tests 2017-05-24 18:38:15 +02:00
Murat Kabilov 86d9b8c71c fix weekday parsing in MaintenanceWindow 2017-05-24 18:38:03 +02:00
Murat Kabilov 94e175eb12 fix NamespacedName decoder 2017-05-24 18:37:36 +02:00