# Set resource limits (optional)
limits = {"cpus": "1", "memory": "512m"}
# Streamlit App Declaration
app("/misc/streamlit_example",
"github.com/streamlit/streamlit-example",
git_branch="master",
spec="python-streamlit",
container_opts=limits)
# FastHTML App Declaration
app("fasthtml.:",
"github.com/AnswerDotAI/fasthtml/examples",
spec="python-fasthtml",
params={"APP_MODULE":"basic_ws:app"},
container_opts=limits)
# Complete config for two apps. Defines where to get the source code, how to build the image, how to route requests and what resource limits to set
apiVersion: apps/v1
kind: Deployment
metadata:
name: streamlit-app
spec:
replicas: 1
selector:
matchLabels:
app: streamlit
template:
metadata:
labels:
app: streamlit
spec:
containers:
- resources:
limits:
memory: "512Mi"
cpu: "1"
# Partial k8s config for one app. Jenkins (CI), ArgoCD, CertManager, IDP etc require additional config.