doudejans / web-scale-data-management

Project work for IN4331 Web-scale Data Management
0 stars 2 forks source link

Local Deployment & Workflows #12

Closed doudejans closed 4 years ago

doudejans commented 4 years ago

This PR adds the first major step towards deploying our microservices: local deployment using Minikube. I wrote a little script that should automatically sets up a Minikube cluster along with the services, Traefik, PostgreSQL and Cassandra. Please refer to the README in order to learn how to use it. Please note that this script is meant for the first time setup only. Once you have everything up and running, you're better off just stopping the cluster using minikube stop and restarting it later using minikube start when you need it again.

This PR also adds GitHub Workflows for the microservices which checks various flake8 errors and builds and pushes Docker images for the services.

Some notes:

My apologies for the size of this PR. However, a lot of files are very similar.

nbelzer commented 4 years ago

I was looking at some solution to help manage the many k8s files but apparently it's not that easy. I found this StackOverflow question which suggests to use Helm. Perhaps someone wants to look in to that in a separate issue down the line.

doudejans commented 4 years ago

GitHub Actions was acting weird and I couldn't find how to trigger a rerun. Therefore, I force-pushed the last commit amended with no actual changes. 😛

doudejans commented 4 years ago

@plammerts Hmm that is weird... Based on these screenshots I cannot figure out what went wrong on your machine. It looks like Kubernetes managed to start Cassandra successfully but it never became ready, hence the repeatedly failing readiness probes. Once Cassandra works properly, the other services likely will start correctly as well. Probably your best bet is to double-check the Cassandra logs using kubectl logs cassandra-0.

mcomans commented 4 years ago

The exact same thing is happening on my machine. There is nothing weird going on in the cassandra logs:

image
doudejans commented 4 years ago

@mcomans Seems like it is just hanging on startup. Might be some kind of memory issue. I'll try to look into it.

mcomans commented 4 years ago

Seemed to be a memory issue, with 4GB of memory for minikube the deployment works.

doudejans commented 4 years ago

I tested various configurations in order to see if I could get the memory requirement down. However, Cassandra seems to be very picky about the memory that it needs. It seemed to work with about 3.5GB allocated to Minikube but cluster operations would be very slow or even unresponsive at that point. I also tried specifying resources for Cassandra specifically but to no avail. Therefore, I just pushed a commit that edits the setup script to start Minikube with 4GB of memory (and lowers the disk space to 10GB). This seems to work reliably for me. Hopefully this amount is fine on your machines as well.