Reputation: 93
I'm trying to setup a local kubernetes development kluster with minikube and can't mount my python file to a pod.
I have a server.py file in my src directory that i mount onto the serverpod:
apiVersion: v1
kind: Pod
metadata:
labels:
app: web
name: serverpod
spec:
containers:
-
imagePullPolicy: IfNotPresent
image: flaskserver
name: testserver
ports:
-
containerPort: 8000
volumeMounts:
- name: src-config
mountPath: /src
volumes:
- name: src-config
hostPath:
path: /home/user/project/src
Dockerfile
FROM python:3
EXPOSE 8000
RUN pip install flask
RUN mkdir /src
CMD [ "python", "src/server.py" ]
The pod does not seem to find the server.py file, not sure if i'm using this right.
Upvotes: 1
Views: 485