I deployed the app on K8s cluster (EKS). But when I checked the link, it is just a blank page with the page title as Streamlit and nothing else. I see a lot of Failed to load resource: the server responded with a status of 404 ()
console errors for the js and css files when I inspect the page.
Dockerfile:
RUN pip install --upgrade pip
COPY ./my-streamlit-app /projects/my-streamlit-app
WORKDIR /projects/my-streamlit-app
RUN pip install -r requirements.txt
WORKDIR /projects/my-streamlit-app/app/model
ENV PYTHONPATH="/projects/my-streamlit-app"
EXPOSE 8501
CMD streamlit run streamlit_test.py
# also tried running by setting the baseurlpath but I got a 404 error
# CMD streamlit run streamlit_test.py --server.baseUrlPath my_streamlit_path
Deployment:
#Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-streamlit-app-deployment
labels:
app: my-streamlit-app
tier: my-streamlit-app
selector:
matchLabels:
app: my-streamlit-app
tier: my-streamlit-app
replicas: 1
template:
metadata:
name: my-streamlit-app-deployment
labels:
app: my-streamlit-app
tier: my-streamlit-app
spec:
containers:
- name: my-streamlit-app
image: {{ .Values.my_streamlit_app.image.repository }}
imagePullPolicy: Always
ports:
- containerPort: 8501
resources:
limits:
cpu: "1"
memory: 1Gi
requests:
cpu: "1"
memory: 1Gi
Ingress:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: my-streamlit-app
spec:
rules:
- host: {{ .Values.ingress.hostedzone }}
http:
paths:
- path: /my_streamlit_app
backend:
serviceName: my-streamlit-app-service
servicePort: 443
Service:
apiVersion: v1
kind: Service
metadata:
name: my-streamlit-app-service
spec:
type: ClusterIP
ports:
- port: 443
protocol: TCP
targetPort: 8501
selector:
app: my-streamlit-app
tier: my-streamlit-app
Can’t figure out what’s wrong >.<