I'm running multiple web pods for the same application and I have this
folder in my application where clients can upload their files.
the folder is sitting in this directory /usr/local/tomcat/webapps/ROOT/uploadfiles and I want it to be shared between all the web pods,
in case the client login to a random session within a specific web POD 1 and upload some files there, can find them next time he logs in to another random session within another web POD N
I'm using Google Cloud Platform container engine and Google persistent disk as persistent volume
my web application Dockerfile for my image and DEPLOYMENT YAML files looks something like this
FROM tomcat:8-jre8
ADD ROOT.war /usr/local/tomcat/webapps/
CMD ["catalina.sh", "run"]
---------------------------------------
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: web-pv-claim
labels:
name: web-pod
version: v1
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
------------------
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: web-dp
labels:
name: web-pod
version: v1
spec:
containers:
name: web-pod
ports:
- containerPort: 8080
volumeMounts:
- name: persistent-storage
mountPath: /usr/local/tomcat/webapps
ports:
- containerPort: 8080
volumes:
- name: persistent-storage
persistentVolumeClaim:
claimName: web-pv-claim
I get this error HTTP Status 404 - /monta
type Status report
message /monta
description The requested resource is not available.
Apache Tomcat/8.0.41
it's the same war file, my application worked fine without volume but as soon as I mountpath: /usr/local/tomcat/webapps I get that error also when i mountpath to a different directory like for example /sample then /usr/local/tomcat/webapps and /sample will have the same exact folders and files !!! and when I upload a file I only see it in the /usr/local/tomcat/webapps/ROOT/uploadefiles inside a specific pod and not shared to the other pods