<p>In kubernetes I can currently limit the CPU and Memory of the containers, but what about the hard disk size of the containers.</p>

<p>For example, how could I avoid that someone runs a container in my k8s worker node that stores internally .jpg files making this container grow and grow with the time.</p>

<p>Not talking about Persistent Volume and Persistent Volume Claim. I'm talking that if someone makes an error in the container and write inside the container filesystem I want to control it.</p>

<p>Is there a way to limit the amount of disk used by the containers?</p>

<p>Thank you.</p>

Jxadro
<p>There is some support for this; the tracking issues are <a href="https://github.com/kubernetes/features/issues/361" rel="nofollow noreferrer">#361</a>, <a href="https://github.com/kubernetes/features/issues/362" rel="nofollow noreferrer">#362</a> and <a href="https://github.com/kubernetes/features/issues/363" rel="nofollow noreferrer">#363</a>. You can define requests and/or limits on the resource called <code>ephemeral-storage</code>, like so (for a Pod/PodTemplate):</p>

<pre><code>spec:
  containers:
  - name: foo
    resources:
      requests:
        ephemeral-storage: 50Mi
      limits:
        ephemeral-storage: 50Mi
</code></pre>

<p>The page <a href="https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/" rel="nofollow noreferrer">Reserve Compute Resources for System Daemons</a> has some additional information on this feature.</p>
