I have a Deployment that runs one container with a root user. It's perfectly clear that everything my application saves under /data will be ephemeral if I don't have any type of persistent volume and volumeMounts defined.

My question is what would be the purpose of specifying an emptyDir Volume and mounting it to /data? If I don't use fancy features for emptyDir like medium or sizeLimit isn't it the same as using no volumes at all?

1

Best Answer


One of the main features of the emptyDir is that it can be mounted on multiple containers inside the same Pod.If you don't use this feature I guess there is not much to gain from it. If I remember correctly emptyDirs are preserved when the container inside the pod are restarted but not when the pod is re-scheduled.