Commit Graph

251 Commits

Author SHA1 Message Date
Murat Kabilov e7e7a7d307 wip 2017-07-28 11:06:57 +02:00
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 9c19a22a7f fix typos 2017-07-25 00:41:28 +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 72a8fcc9aa remove unnecessary vars and funcs 2017-07-24 21:13:13 +02:00
Murat Kabilov fc8f0916a5 fix exec 2017-07-24 19:45:17 +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 2161a0816c use scheme package instead of api 2017-07-18 12:24:15 +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 51672b9e79 Merge branch 'master' into client-go-v4 2017-07-17 12:27:27 +02:00
Murat Kabilov b70c5b3a63 Merge branch 'master' into feature/diagnostic-rest-api 2017-07-17 11:56:47 +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 7a2643386c Merge branch 'master' into fix/graceful-shutdown 2017-07-14 18:16:36 +02:00
Murat Kabilov 4f36e447c3 Skip config params with no values (#62) 2017-07-14 17:22:25 +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 820ce85d4d fix import 2017-07-12 14:04:43 +02:00
Murat Kabilov 3fbe8ed7e0 remove unused import 2017-07-12 13:59:05 +02:00
Murat Kabilov ce2648c62e client-go v4.0.0-beta0
go fmt

glide
2017-07-12 12:54:19 +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