title: How is volume size of HostPath mount determined?
body: <p>Now I got a logs volume:</p>
  <pre><code>      - name: log
          hostPath:
            path: /opt/cloud/logs/sample
  </code></pre>
  <p>and when I execute <code>cd /opt/cloud/logs/sample;df -h .</code>, it shows：</p>
  <pre><code>Filesystem      Size  Used Avail Use% Mounted on
  /dev/vda1        40G   11G   27G  29% /opt/cloud/logs/sample
  </code></pre>
  <p>My question is: where is the 40G number came from? Is there a way to limit this to another number like 30GB? What happens if the container used up 40G, get evicted or the disk size just magically bump to a higher number?</p>
  <h3>Edit</h3>
  <p>I just find out 40G is the size of host disk. But if I use an emptyDir instead of hostPath, it only got 9.8G size，which corresponded to size of <code>/mnt/paas/kubernetes/kubelet</code> on the host, which I have no idea what it is or why it is 9.8G.</p>
  <p>k8s version:</p>
  <pre><code>Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;11&quot;, GitVersion:&quot;v1.11.9&quot;, GitCommit:&quot;16236ce91790d4c75b79f6ce96841db1c843e7d2&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2019-03-25T06:40:24Z&quot;, GoVersion:&quot;go1.10.8&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
  Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;13+&quot;, GitVersion:&quot;v1.13.10-r1-CCE2.0.28.B001&quot;, GitCommit:&quot;0de6083f712a799642f25141c60fdeff34d5514c&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2019-10-30T14:19:27Z&quot;, GoVersion:&quot;go1.11.13&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
  </code></pre>