A project where I aimed to deploy an application (frontend - backend/API - DB) in Minikube to gain applied knowledge and experiment with stateful workloads in K8s.
- For the Database I chose Apache Cassandra, as it seemed interesting and I didn't have specific requirements
Being the stateful component of the application, it required persistent storage, which was provisioned locally using the local-path-provisioner (https://github.com/rancher/local-path-provisioner)
The replication and volume claims are handled by a stateful set and the networking by a headless service - The Backend is a simple Flask API with two functions that are invoked by GET requests
The first one reads the value from the DB and returns it and the second one, increments the value in the DB by 1 and returns the new value
The communication with the DB is established using the DataStax python driver for Cassandra (https://github.com/datastax/python-driver)
The replication is handled by a deployment and the networking by a standard service - The Frontend is a simple React application that displays your visitor number. The function:
a) Checks the local storage for the value and if it doesn’t exist it, calls the backend write function
b) If the value already exists in local storage (the website has already been visited), calls the backend read function
The replication is handled by a deployment and the networking by a standard service - To make the application accessible I created an ingress leveraging minikube's nginx ingress controller
One domain was set for the frontend (webapp.test) and one for the backend (api.webapp.test) which were added to the /etc/hosts file on the host machine.
The Frontend was not created by me. All credits go to my brother, Nick Vasilopoulos (https://www.linkedin.com/in/nickvasilopoulos/)