title: Kubernetes Ephemeral Storage Limit and Container Logs
body: <p>Assuming I have set <code>resource.limits.ephemeral-storage</code> for containers in a Kubernetes cluster (using Docker), and the following Docker daemon.json logging configuration on the worker nodes:</p>
  <pre><code>{
    &quot;log-driver&quot;: &quot;json-file&quot;,
    &quot;log-opts&quot;: {
      &quot;max-size&quot;: &quot;100m&quot;,
      &quot;max-file&quot;: &quot;10&quot;,
    }
  }
  </code></pre>
  <p>My understanding is that all log files (even the rotated log files) will count towards this ephemeral storage limit. This means that to determine the value for <code>resource.limits.ephemeral-storage</code>, I have to consider the maximum allowed log size (here 10*100MB) to the calculation.</p>
  <p>Is there a way to &quot;exclude&quot; log files from counting towards the container's ephemeral-storage limit?</p>
  <p>Since log handling is done &quot;outside&quot; of Kubernetes, I want to avoid that the resource limits for Kubernetes workloads depend on the Docker log configuration. Otherwise any change to the rotation settings (e.g. increase to 10*200MB) could cause pods to be evicted, if one would forget to adjust the limit for each and every container.</p>