<p>I have a pod with the following volume specified</p>

<pre><code>- name: file-storage
  emptyDir:
    medium: Memory
</code></pre>

<p>also have the ephemeral storage specified in the requests and limits:</p>

<pre><code>limits:
  cpu:                2
  ephemeral-storage:  2Gi
  memory:             2Gi
requests:
  cpu:                1
  ephemeral-storage:  2Gi
  memory:             2Gi
</code></pre>

<p>Now I am wondering, will the emptyDir.medium take precedence so that I get to use the RAM or the I get the ephemeral-storage and let kubernetes decide the best for me?</p>

<p>The emptyDir spec with <code>medium: Memory</code> get stored on RAM and count towards your request and limits of memory that you specify. If you remove the <code>medium: Memory</code> then they will be stored on the <code>ephemeral-storage</code>.</p>

<p>This is because <code>medium: Memory</code> spec is created on <code>tmpfs</code> that is allocated from RAM.</p>

<p>If you would like to read more about this please look at the following links:</p>

<p><a href="https://kubernetes.io/docs/concepts/storage/volumes/#emptydir" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/storage/volumes/#emptydir</a>
<a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-emphemeralstorage-consumption" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-emphemeralstorage-consumption</a></p>

<p>Hope this answers your question, let me know if you need more clarity on this.</p>
