A minimal, fully open-source project to deploy a basic Streamlit app connected to MySQL using Kubernetes or OpenShift. Designed for on-prem and hybrid environments.
- Streamlit frontend app
- MySQL database
- Kubernetes manifests for Deployment + Service
- Ingress support
- Minimal setup, GitOps-compatible
- Suitable for educational and testing use
Make sure the following tools are installed and accessible inside your terminal (e.g., WSL2):
- Minikube (Docker driver)
- Docker Engine (running)
- kubectl
- Git
minikube stop
minikube delete
minikube start --driver=docker
minikube addons enable ingress
eval $(minikube docker-env) # Use Minikube’s internal Docker daemon
To undo this later:
eval $(minikube docker-env -u)
docker build -t sample-app:latest ./app
kubectl apply -f manifests/mysql/
kubectl apply -f manifests/app/
kubectl apply -f manifests/ingress/
Forward your local port to the app service:
kubectl port-forward svc/sample-app 8501:80 -n default
Then open in your browser:
http://localhost:8501
Note: It may take a minute or two for the MySQL pod to fully initialize and for the Streamlit app to establish a connection. If the app doesn’t load immediately, wait and refresh the page.
kubectl get pods -n default
Expected output (both pods should be Running):
NAME READY STATUS RESTARTS AGE
mysql-xxxxxxxxxx-xxxxx 1/1 Running 0 2m
sample-app-xxxxxxxxxx-xxxxx 1/1 Running 0 2m
MIT License (see LICENSE)