Skip to content

MatthewOastler/simple-app-k8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-app-k8s (v1 - Simplified)

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.

Features

  • Streamlit frontend app
  • MySQL database
  • Kubernetes manifests for Deployment + Service
  • Ingress support
  • Minimal setup, GitOps-compatible
  • Suitable for educational and testing use

Requirements

Make sure the following tools are installed and accessible inside your terminal (e.g., WSL2):

  • Minikube (Docker driver)
  • Docker Engine (running)
  • kubectl
  • Git

Setup Instructions (Minikube)

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)

Build the Streamlit app

docker build -t sample-app:latest ./app

Deploy the Kubernetes stack

kubectl apply -f manifests/mysql/
kubectl apply -f manifests/app/
kubectl apply -f manifests/ingress/

Access the app (Port-Forward)

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.

Before port-forwarding, you can confirm that all pods are running:

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

License

MIT License (see LICENSE)

About

Minimal Streamlit + MySQL app deployed on Kubernetes (educational & GitOps-ready).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published