This repository contains all deployment and management files for the whole project for REMLA 2023.
To deploy the service stack locally in a single deployment you can use the following docker compose as a start of:
services:
backend:
image: ghcr.io/remla23-team11/app:latest
ports:
- 5000
frontend:
image: ghcr.io/remla23-team11/model-service:latest
ports:
- 8080
environment:
- REACT_APP_API_URL=backend:8080
- REACT_APP_API_URL — Used to set the backend URL that the frontend has to communicate with.
We have converted our .yml file from Docker compose to Kubernetes.
- Start Minikube
$ minikube start
- Enable ingress
$ minikube addons enable ingress
- open minikube dashboard (optional)
$ minikube dashboard
Run the following commands to install the Prometheus stack in your cluster.
$ helm repo add prom-repo https://prometheus-community.github.io/helm-charts
"prom-repo" has been added to your repositories
$ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "prom-repo" chart repository
Update Complete. ⎈Happy Helming!⎈
$ helm repo list
NAME URL
prom-repo https://prometheus-community.github.io/helm-charts
You can run helm repo remove prom-repo should you ever wish to remove it again.
The output contains an important information: the Prometheus instance is labeled with release=myprom.
$ helm install myprom prom-repo/kube-prometheus-stack
...
kube-prometheus-stack has been installed. Check its status by running:
kubectl --namespace default get pods -l "release=myprom"
By default, Prometheus does not have an Ingress, so we need to use a port-forward again to access its website. We are interested in the myprom-kube-prometheus-sta-prometheus service that runs on port 9090. Run and the following command and keep the terminal open to see the dashboard of prometheus.
$ minikube service myprom-kube-prometheus-sta-prometheus --url
Apply the file by the command:
$ kubectl apply -f /kubernetes/restaurant.yml
Once all Pods are in the state Running, run the command below to create a tunnel (keep the terminal open) for the Ingress and open localhost/app in your browser to access the frontend.
$ minikube tunnel
At the user interface, for example, "We are glad we found this place." will be analyzed as a positive sentiment. After pressing 'analyze', the feedback option will appear and after selecting the feedback, submit option will appear. Related metrics will be monitored by prometheus and can be observed through the dashboard.
After setting up the Kubernetes and Prometheus, one can make use of the Grafana dashboard to monitor the service.
You first get the URL to Grafana.
$ minikube service myprom-grafana --url
Then you login with username admin
and password prom-operator
.
Navigate to the dashboards under Home > Dashboards and load the json file in the ./grafana/grafana.json
by clicking New > Import.