<p>Kubernetes has the concept of ephemeral-storage which can be applied by the deployment to a container like this:</p>
<pre><code>limits:
  cpu: 500m
  memory: 512Mi
  ephemeral-storage: 100Mi
requests:
  cpu: 50m
  memory: 256Mi
  ephemeral-storage: 50Mi
</code></pre>
<p>Now, when applying this to a k8s 1.18 cluster (IBM Cloud managed k8s), I cannot see any changes when I look at a running container:</p>
<pre><code>kubectl exec -it &lt;pod&gt; -n &lt;namespace&gt; -c nginx -- /bin/df
</code></pre>
<p>I would expect to see there changes. Am I wrong?</p>

<p>You can see the allocated resources by using <code>kubectl describe node &lt;insert-node-name-here&gt;</code> on the node that is running the pod of the deployment.</p>
<p>You should see something like this:</p>
<pre><code>Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  Resource                       Requests      Limits
  --------                       --------      ------
  cpu                            1130m (59%)   3750m (197%)
  memory                         4836Mi (90%)  7988Mi (148%)
  ephemeral-storage              0 (0%)        0 (0%)
  hugepages-1Gi                  0 (0%)        0 (0%)
  hugepages-2Mi                  0 (0%)        0 (0%)
  attachable-volumes-azure-disk  0             0
</code></pre>
<p>When you requested 50Mi of ephemeral-storage it should show up under <code>Requests</code>.
When your pod tries to use more than the limit (100Mi) the pod will be evicted and restarted.</p>
<p>On the node side, any pod that uses more than its requested resources is subject to eviction when the node runs out of resources. In other words, Kubernetes never provides any guarantees of availability of resources beyond a Pod's requests.</p>
<p>In kubernetes documentation you can find more details how Ephemeral storage consumption management works <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-emphemeralstorage-consumption" rel="noreferrer">here</a>.</p>
<p>Note that using kubectl exec with <code>df</code> command might not show actual use of storage.</p>
<p>According to kubernetes <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#configurations-for-local-ephemeral-storage" rel="noreferrer">documentation</a>:</p>
<blockquote>
<p>The kubelet can measure how much local storage it is using. It does this provided that:</p>
<ul>
<li>the  <code>LocalStorageCapacityIsolation</code>  <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/" rel="noreferrer">feature gate</a>  is enabled (the feature is on by default), and</li>
<li>you have set up the node using one of the supported configurations for local ephemeral storage.</li>
</ul>
<p>If you have a different configuration, then the kubelet does not apply resource limits for ephemeral local storage.</p>
<p><em><strong>Note:</strong>  The kubelet tracks  <code>tmpfs</code>  emptyDir volumes as container memory use, rather than as local ephemeral storage.</em></p>
</blockquote>
