The dashboard prototype for the EVERSE project.
Warning
🚧 Work in Progress
This project is currently under active development and may not yet be fully stable. Features, functionality, and documentation are subject to change as progress continues.
We welcome feedback, contributions, and suggestions! If you encounter issues or have ideas for improvement, please feel free to open an issue or submit a pull request.
- Python (3.12)
- Poetry (1.8.5)
- Podman (5.4.1)
- minikube (v1.34.0)
- helm (v3.16.4)
Links for the requirements
https://www.python.org/downloads
Pyenv allows developers to install multiple versions of Python distribution and easy switching between the installed versions.
Website: https://github.com/pyenv/pyenv?tab=readme-ov-file#installation
Poetry is used for dependency management of the Python packages.
https://python-poetry.org/docs/#installation
https://podman.io/docs/installation
https://docs.docker.com/engine/install
If you would like to run the setup on a cloud (your own server)
-
Start a cluster using
minikubeandpodmanSet the default driver (podman or docker)
minikube config set driver podmanStart the cluster
minikube start --cpus='4' --memory='4g' --driver=podman
This will create a cluster using 4 cpus and 4GB of memory.
The rest of the instructions need to be followed in
kubernetesfolder, so make sure you are in that folder before following the rest of the instructions:cd kubernetes -
Generate Secrets for deployment
bash generate-variables.sh
The script can be customised via environment variables, e.g.
EVERSE_DOMAIN_NAME=my.domain bash generate-variables.sh.It produces the following artefacts (all paths reside under
kubernetes/):- deployments/XXXXXXXXXXXXXDD_MM_YYYYHH_MM/superset-deployment-secrets.yaml
- deployments/XXXXXXXXXXXXXDD_MM_YYYYHH_MM/secrets.env
- deployments/XXXXXXXXXXXXXDD_MM_YYYYHH_MM/generate_jwt.sh
Warning: Do not share any of these generated files with anyone or push to a public repository!
Now you can source the generated
secrets.envfile to set the environment variables which will be used for the deployment.source ./deployments/XXXXXXXXXXXXX**DD_MM_YYYY**HH_MM/secrets.env
The generated environment variables are consumed by the Kubernetes manifests through
envsubst. No plaintext database configuration files are created anymore.For a breakdown of the database schema and helper scripts, see
docs/Database.md. -
Build database initialization container
Build the docker image
docker build --no-cache -t ghcr.io/everse-researchsoftware/postgresql-setup-script:latest -t everse-db-scripts:latest ./DBModel
Load the docker image to the cluster
minikube image load everse-db-scripts:latest
Check if the image is loaded
minikube image ls
Warning: Do not make this Docker image publicly available as it contains database password!
-
Create a namespace
kubectl create namespace superset
-
Add the generated secrets to the cluster
kubectl apply -f $DASHVERSE_SECRETS_FILE_NAME --namespace superset -
Deploy db using
deploy-db.yamlenvsubst < deploy-db.yaml | kubectl apply --namespace superset -f -
You can check the logs of initialization job using:
DB_JOB_POD_NAME=$(kubectl get pods --namespace superset | grep "postgresql-init-job" | cut -d" " -f1) kubectl logs --namespace superset $DB_JOB_POD_NAME -c init-python-container
-
Deploy API using
deploy-postgrest.yamlenvsubst < deploy-postgrest.yaml | kubectl apply --namespace superset -f -
You can check the logs using:
POSTGREST_POD_NAME=$(kubectl get pods --namespace superset | grep "postgrest-" | cut -d" " -f1) kubectl logs --namespace superset $POSTGREST_POD_NAME --all-containers
Test using:
curl https://db.YOUR_DOMAIN/assessment
-
Deploy Apache Superset using
dashverse-values.yamlAdd superset repository to helm:
helm repo add Superset https://apache.github.io/superset
Set up Apache Superset:
envsubst < dashverse-values.yaml > dashverse-values-with-secrets.yaml helm upgrade --install superset superset/superset --values dashverse-values-with-secrets.yaml --namespace superset --create-namespace --debug --cleanup-on-fail rm -f dashverse-values-with-secrets.yaml
Below are the commands you can use for debugging the superset service.
kubectl describe job --namespace superset superset-init-db
kubectl logs --namespace superset superset-init-db-7nccv # replace this with the actual namekubectl get pods --namespace superset -l job-name=superset-init-db
kubectl describe pod --namespace superset superset-init-db-hczfw
-
OPTIONAL - Deploy pgadmin
envsubst < deploy-pgadmin.yaml | kubectl apply --namespace superset -f -
To add the Postgresql database on pgadmin UI:
Add a New server: General: Name --> postgres Connection: Host name --> superset-postgresql Port --> 5432 Username --> $POSTGRES_USER in `XXXXXXXXXXXXX-superset-deployment-secrets` file Password --> see $POSTGRES_PASSWORD in `XXXXXXXXXXXXX-superset-deployment-secrets` file -
Get the application URL by running these commands:
kubectl get --namespace superset services
export SUPERSET_NODE_PORT=$(kubectl get --namespace superset -o jsonpath="{.spec.ports[0].nodePort}" services superset) export POSTGREST_NODE_PORT=$(kubectl get --namespace superset -o jsonpath="{.spec.ports[0].nodePort}" services postgrest) export SWAGGER_NODE_PORT=$(kubectl get --namespace superset -o jsonpath="{.spec.ports[0].nodePort}" services swagger) export NODE_IP=$(kubectl get nodes --namespace superset -o jsonpath="{.items[0].status.addresses[0].address}") echo "superset: " http://$NODE_IP:$SUPERSET_NODE_PORT echo "postgrest: " http://$NODE_IP:$POSTGREST_NODE_PORT echo "swagger: " http://$NODE_IP:$SWAGGER_NODE_PORT
-
Set up the domain name for your server
-
Set DNS to point to your server ( you will need to setup a reverse proxy to be able to access the service)
docs/Kubernetes.md– operational commands for managing the Minikube deployment.docs/Database.md– details of the PostgreSQL schema, assessment mapping, and populate script usage.docs/API_examples.md– practical PostgREST calls, including the multi-step workflow for creating assessments.
List services
kubectl get --namespace superset servicesDelete services
# database
kubectl delete service --namespace superset superset-postgresql
# postgrest API
kubectl delete service --namespace superset postgrest
kubectl delete service --namespace superset swagger
# pgadmin
kubectl delete service --namespace superset pgadmin
# superset
kubectl delete service --namespace superset superset
kubectl delete service --namespace superset superset-redis-headless
kubectl delete service --namespace superset superset-redis-masterList deployments
kubectl get deployments --namespace supersetDelete deployments
# database
kubectl delete deployment --namespace superset superset-postgresql
kubectl delete deployment --namespace superset postgrest
# pgadmin
kubectl delete deployment --namespace superset pgadmin
# superset
kubectl delete deployment --namespace superset superset
kubectl delete deployment --namespace superset superset-workerList pvcs
kubectl get pvc --namespace superset
Delete pvcs
kubectl delete pvc --namespace superset superset-postgresql-data-pvc
kubectl delete pvc --namespace superset pgadmin-pvcminikube --namespace superset service list
#minikube --namespace superset service --all
minikube --namespace superset service superset-postgresql --url
minikube --namespace superset service superset --url
minikube --namespace superset service postgrest --url
minikube --namespace superset service swagger --url
minikube --namespace superset service pgadmin --url
kubectl get --namespace superset services
kubectl get --namespace superset deployments
kubectl get --namespace superset deployments.apps
kubectl get pods --all-namespaces
kubectl get pods --namespace superset
kubectl describe pod --namespace superset superset-postgresql-774c87bbfc-vn5mk # show the details of a specific pod
kubectl describe pods --namespace superset
kubectl cluster-info
kubectl get pods -l app=superset-postgresql --namespace superset
kubectl get jobs -l job-name=superset-postgresql-init-job --namespace superset
kubectl logs -f <superset-postgresql-init-job-pod-name> --namespace supersetkubectl get pods --namespace superset
kubectl exec -ti superset-postgresql-6c8dd65c-5k4d4 --namespace superset -- bash
psql -U postgres -d postgres -h localhostNote: use your own username and password for the psql command
minikube dashboard --urlkubectl proxy --address='0.0.0.0' --disable-filter=truehttp://SERVER_IP:8001/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/#/workloads?namespace=superset
minikube stop
minikube delete --purge --all