helpful-beard-54962
10/31/2022, 9:45 AMapiVersion: v1
kind: Pod
metadata:
name: shared-storage-example
spec:
volumes:
- name: shared-data
emptyDir: {}
containers:
- name: container-1
image: nginx
volumeMounts:
- name: shared-data
mountPath: /usr/share/nginx/html
- name: container-2
image: debian
volumeMounts:
- name: shared-data
mountPath: /data
command: ["/bin/sh"]
args: ["-c", "echo Hello world > /data/index.html"]
This simple configuration doesn't work in Rancher
1. Started 1 deployment with this config
2. Increased the pods in the container to 3
3. The files created in /data
are NOT shared between the 3 containers
I do not want to use persistent volume claims because I don't need them to be persistent, I just need a folder to shared data ONLY between the pods in a deployment and for that data to be destroyed when the deployment is deletedfull-painter-23916
10/31/2022, 11:16 AMhelpful-beard-54962
10/31/2022, 11:27 AMfull-painter-23916
10/31/2022, 9:08 PM