I need a shared volume accessible from multiple pods for caching files in RAM on each node.
The problem is that the emptyDir
volume provisioner (which supports Memory
as its medium
) is available in Volume
spec but not in PersistentVolume
spec.
Is there any way to achieve this, except by creating a tmpfs
volume manually on each host and mounting it via local
or hostPath
provisioner in the PV spec?
Note that Docker itself supports such volumes:
docker volume create --driver local --opt type=tmpfs --opt device=tmpfs \
--opt o=size=100m,uid=1000 foo
I don't see any reason why k8s doesn't. Or maybe it does, but it's not obvious?
I tried playing with local
and hostPath
PVs with mountOptions
but it didn't work.