<p>I used volume with these configuration in kubernetes:</p>

<pre><code>emptyDir:
  medium: Memory
</code></pre>

<p>How to dynamically/programatically figure out the host path on the nodes?</p>

SOWMITHRA KUMAR G M
<p>Basing on the official <a href="https://kubernetes.io/docs/concepts/storage/volumes/#emptydir" rel="nofollow noreferrer">documentation</a>:</p>

<blockquote>
  <p>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.</p>
</blockquote>

<p>If I understand you correctly (and by <code>host path</code> you doesn't mean <a href="https://kubernetes.io/docs/concepts/storage/volumes/#hostpath" rel="nofollow noreferrer">hostPath</a>) you can simply execute <code># df -h</code> which will display how much disk space is available in a human readable form. Also showing:</p>

<ul>
<li>Filesystem (in your case <code>tmpfs</code>)</li>
<li>Size</li>
<li>Used</li>
<li>Available</li>
<li>Use%</li>
<li>Mounted on</li>
</ul>

<p>It's worth noting that the default size of a RAM-based <code>emptyDir</code> is half the RAM of the node it runs on.</p>

<p>Please let me know if that helps. </p>
