# How to limit resource usage on local storage?

**URL:** <https://discuss.kubernetes.io/t/how-to-limit-resource-usage-on-local-storage/7142>\
**Category:** General Discussions\
**Created:** [July 15, 2019, 8:39am UTC](https://discuss.kubernetes.io/t/how-to-limit-resource-usage-on-local-storage/7142 "2019-07-15T08:39:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.kubernetes.io/u/asp)\
**Post date:** [July 15, 2019, 8:39am UTC](https://discuss.kubernetes.io/t/how-to-limit-resource-usage-on-local-storage/7142/1 "2019-07-15T08:39:59Z")

</div>

Hi,

I a using kubernetes 1.14. and I am using local storage: [Volumes - Kubernetes](https://kubernetes.io/docs/concepts/storage/volumes/#local)

I am mouting a directory.  
When creating PV and PVC I set 30Gi for the size.

kubectl get pv

```
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
storage-data-poc-es-master-0 30Gi RWO Delete Bound default/storage-data-poc-es-master-1 local-storage 2d18h
storage-data-poc-es-master-1 30Gi RWO Delete Bound default/storage-data-poc-es-master-0 local-storage 2d18h
storage-data-poc-es-master-2 30Gi RWO Delete Bound default/storage-data-poc-es-master-2 local-storage 2d18h

```

kubectl get pvc

```
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
storage-data-poc-es-master-0 Bound storage-data-poc-es-master-1 30Gi RWO local-storage 2d18h
storage-data-poc-es-master-1 Bound storage-data-poc-es-master-0 30Gi RWO local-storage 2d18h
storage-data-poc-es-master-2 Bound storage-data-poc-es-master-2 30Gi RWO local-storage 2d18h

```

But my application is saying there are 120GB free what is fitting the underlying drive.  
What options do I have to limit the **local** storage (transparently) to my application?

Thanks  
Andreas

---

<div class="post-metadata">

**Author:** ![mrbobbytables](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/mrbobbytables/32/7_2.png) [@mrbobbytables](https://discuss.kubernetes.io/u/mrbobbytables)\
**Post date:** [July 15, 2019, 11:29am UTC](https://discuss.kubernetes.io/t/how-to-limit-resource-usage-on-local-storage/7142/2 "2019-07-15T11:29:21Z")

</div>

> [@asp](#):
>
> But my application is saying there are 120GB free what is fitting the underlying drive.  
> What options do I have to limit the **local** storage (transparently) to my application?

You cannot limit local storage through kubernetes directly. You would need to create a volume on the host that has the desired limitation ahead of time with something like lvm.

---

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.kubernetes.io/u/asp)\
**Post date:** [July 15, 2019, 11:31am UTC](https://discuss.kubernetes.io/t/how-to-limit-resource-usage-on-local-storage/7142/3 "2019-07-15T11:31:14Z")

</div>

thanks, hoped it would be easier 😉
