NBISweden / LocalEGA

Please go to to https://github.com/EGA-archive/LocalEGA instead
Apache License 2.0
4 stars 1 forks source link

Adding kubernetes deployment #320

Closed blankdots closed 6 years ago

blankdots commented 6 years ago

Deployment of LocalEGA to Kubernetes/Openshift clusters includes:

Missing: details added for http://localega.readthedocs.io/ - I think these should come after the PR is reviewed and approved.

Do we need a travis stage to test this?

Most likely yes. Example here: https://github.com/LiliC/travis-minikube/blob/master/.travis.yml but most likely we will need to adjust current tests.

Where has this been tested?

So far only minikube, testing deployment on other Kubernetes/Openshift clusters is work in progress.

Will we have Horizontal Pod auto-scaling?

~Yes, if I am fast enough to test it and commit it.~ - Added simple autoscale based on average CPU utilisation . If we need other metrics we need to change to V2beta1 instead of V1 API.

How does one review this?

There are instructions in README or just ask for video demo.

dtitov commented 6 years ago

I tested it with Minicube. Deployment works (haven't deployed cega-users though), but I didn't try the functionality itself (e.g. submission or ingestion). There are some small comments above and a major suggestion to include cega-users generation in the deploy.py

Another suggestion from me is to brainstorm which services do we want to have as Deployments and which as Stateful sets, because it appeared that it's not that obvious decision. For now, I guess, we can make them all to be Deployments (based on this article: https://akomljen.com/kubernetes-persistent-volumes-with-deployment-and-statefulset/) and then, after we discuss it, we can switch some of them to Stateful sets.

blankdots commented 6 years ago

The purpose of the issue was to set up LocalEGA not to replicate the bootstrap from the docker-compose. Connection to CEGA should be known when setting up LocalEGA. I made cega-mq and cega-users just for testing purposes the same for the testing script, these could have well be missing from this PR.

This being said I will add fake-cega to deploy script (bear in mind the deploy script was just an idea, and it turned out to be a simple way).

Regarding StatefulSet vs Deployments I agree only with moving PostgresDB to a StatefulSet only if there is a clear requirement running it in a cluster like setup ... and of course do another PR with it. For now it works and it is tested, if there are other requirements this means a new issue.

dtitov commented 6 years ago

I tested the new version (with cega-users in the deploy.py) and it works like a charm 👍

$ minikube service list
|-------------|----------------------|--------------------------------|
|  NAMESPACE  |         NAME         |              URL               |
|-------------|----------------------|--------------------------------|
| default     | kubernetes           | No node port                   |
| kube-system | kube-dns             | No node port                   |
| kube-system | kubernetes-dashboard | http://192.168.99.100:30000    |
| testing     | cega-mq              | http://192.168.99.100:32703    |
|             |                      | http://192.168.99.100:31314    |
|             |                      | http://192.168.99.100:31063    |
| testing     | cega-mq-management   | http://192.168.99.100:31668    |
| testing     | cega-users           | http://192.168.99.100:30250    |
| testing     | db                   | No node port                   |
| testing     | inbox                | http://192.168.99.100:31882    |
| testing     | keys                 | No node port                   |
| testing     | minio                | No node port                   |
| testing     | minio-service        | http://192.168.99.100:32650    |
| testing     | mq                   | No node port                   |
| testing     | mq-management        | http://192.168.99.100:30669    |
|-------------|----------------------|--------------------------------|
dtitov commented 6 years ago

Sucessfully tested it manually ✅

P.S. Just add the --stableID before EGAF$(shell cat $(FILE).md5) in the test Makefile.

dtitov commented 6 years ago

LGTM.