title: How can I determine the current ephemeral-storage usage of a running Kubernetes pod?
body: <p>How can I tell with <code>kubectl</code> how much <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#local-ephemeral-storage" rel="noreferrer">ephemeral storage</a> a pod is currently using?</p>
  
  <p>In a Kubernetes pod spec, I can specify resource requests and limits for CPU, memory, and ephemeral storage:</p>
  
  <pre><code>resources:
    requests:
      memory: "60Mi"
      cpu: "70m"
      ephemeral-storage: "2Gi"
    limits:
      memory: "65Mi"
      cpu: "75m"
      ephemeral-storage: "4Gi"
  </code></pre>
  
  <p>However, to set good requests and limits on ephemeral storage, I need to know what this value actually is for a running pod, which I can't figure out. I can get CPU and memory usage using <code>kubectl top pod</code>, but, from what I can tell, <a href="https://github.com/kubernetes/kubernetes/blob/30a06af453059ffe636f483b7db914d51757139a/pkg/kubelet/eviction/eviction_manager.go#L503" rel="noreferrer">ephemeral storage usage is only actually calculated when making an actual eviction decision</a>.</p>