I used volume with these configuration in kubernetes:
emptyDir:
medium: Memory
How to dynamically/programatically figure out the host path on the nodes?
Basing on the official documentation:
By default, emptyDir volumes are stored on whatever medium is backing the node - that might be disk or SSD or network storage, depending on your environment. However, you can set the emptyDir.medium field to "Memory" to tell Kubernetes to mount a tmpfs (RAM-backed filesystem) for you instead. While tmpfs is very fast, be aware that unlike disks, tmpfs is cleared on node reboot and any files you write will count against your Container’s memory limit.
If I understand you correctly (and by host path
you doesn't mean hostPath) you can simply execute # df -h
which will display how much disk space is available in a human readable form. Also showing:
tmpfs
)It's worth noting that the default size of a RAM-based emptyDir
is half the RAM of the node it runs on.
Please let me know if that helps.