1
votes

So I see a related question that wants to control the emptyDir size here: Setting Kubernetes emptyDir volume size. I see that if this limit gets hit, the pod itself will be evicted.

Also I know know that emptyDir would be half the request RAM. So does that mean if I try to provision 2 or more emptyDir volumes in a pod, it would fail? Or will it just be all virtual memory allocation and I can over-provision in that sense?

What I am possibly trying to get at is that I would want not a hard limit for my volume that would trash the pod itself, but accommodate in RAM if the other volumes are not in use. Of course if the total goes beyond the RAM, I would expect the pod to be trashed.

1

1 Answers

4
votes

emptyDir volumes are disk-backed by default; there's no particular prohibition against mounting multiple ones.

That documentation also notes:

However, you can set the emptyDir.medium field to "Memory" [... and if you do ...] any files you write will count against your Container's memory limit.

So the ordinary pod resource limits apply here: if you set a memory limit, and the combined application memory and tmpfs usage goes above that limit, the pod will get killed.