This repository contains the code of a demo app developed with Flask that calculates the Fibonacci number in the most non-optimised way possible.
The application provides the user with a simple form to type in the n-th term of the sequence. Every time a new calculation is submitted, a job gets created and a celery worker, using rabbitmq as message broker, will pick up the job to perform the calculation.
A list of all jobs created is also presented below the form.
An instance of flower is also included to monitor celery.
Node Ports:
- flask app:
30081
- flower:
30082
Just as simple as running:
$ docker-compose up --build
In order to deploy the demo app stack on a kubernetes cluster, you must build and push the images into a container registry. In this repository, we will make use of docker hub.
Please login into docker hub with the command:
$ docker login
Steps:
-
Set docker hub username in
.env
fileDOCKERHUB_USERNAME=arturosoucase
-
Build images
$ docker-compose build
-
Push images into Docker Hub
$ docker-compose push
-
Apply kubernetes manifest files:
$ kubectl apply -f manifests/