Commit Graph

90 Commits

Author SHA1 Message Date
Murat Kabilov 1a4cff6574 Merge branch 'master' into feature/diagnostic-rest-api
# Conflicts:
#	pkg/controller/controller.go
2017-07-27 14:35:51 +02:00
Murat Kabilov ed0db7193c Merge branch 'master' into feature/diagnostic-rest-api
# Conflicts:
#	pkg/controller/controller.go
#	pkg/controller/postgresql.go
2017-07-27 14:32:19 +02:00
Murat Kabilov 2fe22ff614 Remove pod dispatcher 2017-07-27 14:16:49 +02:00
Murat Kabilov 3ad4b127c4 Fix graceful shutdown
graceful shutdown of goroutines on operator exit
2017-07-27 12:54:22 +02:00
Murat Kabilov 5db09facd5 go fmt 2017-07-27 11:27:08 +02:00
Murat Kabilov b0b25ecfd3 add error field for cluster status 2017-07-26 17:35:10 +02:00
Murat Kabilov 9b58816269 fix 2017-07-26 17:16:37 +02:00
Murat Kabilov 75218fec34 fix 2017-07-26 17:16:23 +02:00
Murat Kabilov 9f9e841bf3 fix 2017-07-26 17:16:03 +02:00
Murat Kabilov 4d4fc394df api server 2017-07-26 17:00:52 +02:00
Murat Kabilov 102b72e8bf add pprof 2017-07-25 17:20:55 +02:00
Murat Kabilov 54defa8070 Merge branch 'fix/graceful-shutdown' into feature/diagnostic-rest-api
# Conflicts:
#	pkg/controller/controller.go
#	pkg/controller/pod.go
#	pkg/controller/postgresql.go
2017-07-25 17:09:22 +02:00
Murat Kabilov 28a63c695c Merge branch 'master' into feature/diagnostic-rest-api
# Conflicts:
#	pkg/controller/controller.go
#	pkg/controller/pod.go
2017-07-25 16:38:40 +02:00
Murat Kabilov 27e21c6ec8 fix strange argument order 2017-07-25 15:55:07 +02:00
Murat Kabilov 9bff6cff39 merge with master 2017-07-25 15:44:47 +02:00
Murat Kabilov 50aaa16574 Merge branch 'master' into fix/graceful-shutdown
# Conflicts:
#	pkg/cluster/cluster.go
#	pkg/cluster/exec.go
#	pkg/cluster/k8sres.go
#	pkg/cluster/pod.go
#	pkg/cluster/resources.go
#	pkg/cluster/util.go
#	pkg/cluster/volumes.go
#	pkg/controller/controller.go
#	pkg/controller/pod.go
#	pkg/controller/postgresql.go
#	pkg/controller/util.go
#	pkg/controller/util_test.go
#	pkg/spec/postgresql.go
#	pkg/spec/postgresql_test.go
#	pkg/util/util.go
#	pkg/util/util_test.go
2017-07-25 15:41:06 +02:00
Murat Kabilov 1f8b37f33d Make use of kubernetes client-go v4
* client-go v4.0.0-beta0
* remove unnecessary methods for tpr object
* rest client: use interface instead of structure pointer
* proper names for constants; some clean up for log messages
* remove teams api client from controller and make it per cluster
2017-07-25 15:25:17 +02:00
Murat Kabilov 848a37e94d merge with refactor-tpr 2017-07-25 10:41:14 +02:00
Murat Kabilov acebdf0122 Merge branch 'feature/refactor-tpr' into fix/graceful-shutdown
# Conflicts:
#	pkg/controller/controller.go
2017-07-25 10:38:33 +02:00
Murat Kabilov 941bfb3cc5 remove teams api client from controller and make it per cluster 2017-07-25 01:01:49 +02:00
Murat Kabilov 0ed47c7aea fix controller util test 2017-07-25 00:36:10 +02:00
Murat Kabilov 2bbcb5f627 split init controller; make controller config private 2017-07-25 00:35:52 +02:00
Murat Kabilov a30329e04a fix list cluster 2017-07-24 21:55:04 +02:00
Murat Kabilov b2a882f9fd merge with master 2017-07-24 21:42:57 +02:00
Murat Kabilov 035069137a Merge branch 'master' into feature/refactor-tpr
# Conflicts:
#	cmd/main.go
#	pkg/cluster/cluster.go
#	pkg/controller/controller.go
#	pkg/controller/util.go
2017-07-24 21:21:42 +02:00
Murat Kabilov 143eb968ea refactor 2017-07-24 19:38:08 +02:00
Oleksii Kliukin 4455f1b639 Feature/unit tests (#53)
- Avoid relying on Clientset structure to call Kubernetes API functions.
While Clientset is a convinient "catch-all" abstraction for calling
REST API related to different Kubernetes objects, it's impossible to
mock. Replacing it wih the kubernetes.Interface would be quite
straightforward, but would require an exra level of mocked interfaces,
because of the versioning. Instead, a new interface is defined, which
contains only the objects we need of the pre-defined versions.

-  Move KubernetesClient to k8sutil package.
- Add more tests.
2017-07-24 16:56:46 +02:00
Murat Kabilov d7e9142fc7 proper names for constants; some clean up for log messages 2017-07-24 12:37:06 +02:00
Murat Kabilov 129bcd7bd6 rest client: use interface instead of structure pointer 2017-07-17 17:08:40 +02:00
Murat Kabilov 3165106317 use get parameter for k8s resource watch url 2017-07-17 17:07:16 +02:00
Murat Kabilov 4d936fc3a1 use proper ParameterCodec 2017-07-17 15:21:06 +02:00
Murat Kabilov 7206cd0cdb Merge branch 'client-go-v4' into fix/graceful-shutdown
# Conflicts:
#	pkg/controller/pod.go
2017-07-17 11:12:36 +02:00
Murat Kabilov f7774803b6 get rid of unnecessary goroutines 2017-07-17 10:37:14 +02:00
Murat Kabilov f326e58456 add waiting group in the main thread 2017-07-14 18:19:56 +02:00
Murat Kabilov 17711d5087 graceful shutdown goroutines on operator exit 2017-07-14 16:00:49 +02:00
Murat Kabilov 27b485641e diagnostic rest api [WIP] 2017-07-14 15:58:59 +02:00
Murat Kabilov ce2648c62e client-go v4.0.0-beta0
go fmt

glide
2017-07-12 12:54:19 +02:00
Oleksii Kliukin e0dacd0ca9 Remove an unused export. 2017-06-08 16:17:01 +02:00
Murat Kabilov e104a67260 Fix resync of the clusters 2017-06-08 11:51:48 +02:00
Oleksii Kliukin bc0e9ab4bc Add error checks per report from errcheck-ng 2017-06-08 10:41:44 +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
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 009db16c7c Use queues for the pod events (#30) 2017-05-23 15:24:14 +02:00
Murat Kabilov c470bd6646 reset cluster error on successful update or sync (#29) 2017-05-22 15:45:38 +02:00
Oleksii Kliukin bc17897478 Run sync cluster when previous add failed. (#28) 2017-05-22 15:27:26 +02:00
Oleksii Kliukin afce38f6f0 Fix error messages (#27)
Use lowercase for kubernetes objects
Use %v instead of %s for errors
Start error messages with a lowercase letter.
2017-05-22 14:12:06 +02:00
Murat Kabilov 4acaf27a5d Remove etcd requests (#25)
update glide
2017-05-19 17:18:37 +02:00
Murat Kabilov d34273543e Fix the golint, gosimple warnings 2017-05-18 17:38:54 +02:00
Murat Kabilov 233e8529c1 Return error instead of logging it 2017-05-18 17:24:44 +02:00