Use of non-persistent volume for single container in Kubernetes's pod

9/10/2020

What's the use case for mounting a non-persistent volume when one has a single container in a kubernetes pod?

I understand that mounting a non-persistent volume (that goes away when a pod dies) can be useful if one has multiple containers in the pod, because it's a way for the different containers to share storage.

But is there a case in which I might want or have to mount a non-persistent volume for a single container, instead of having the container use its filesystem?

-- Michele Piccolini
containers
kubernetes
mounted-volumes

1 Answer

9/10/2020

On a single container use case, a non-persistent volume can be useful depending on the workload.

Interesting use of volumes is when you have high IOP drives directly attached to the nodes, some cloud providers offer the ability to attach SSD drives to the nodes increasing the IOP performance, or in on-premise installations where you can have M2 drives.

Then if your workloads are high IOP demanding to process data, for example when you have a lot of data ingestion and need to process it before sending it to a database or queue system having very fast temporary storage can increase the performance.

-- wolmi
Source: StackOverflow