K8S persistent volume resizing dynamically using rules

8/24/2018

Read this excellent article:https://kubernetes.io/blog/2018/08/02/dynamically-expand-volume-with-csi-and-kubernetes/

Does k8s support dynamic auto resize based on some rules i.e. If the volume space is 90% used, auto resize the volume upto a configured max limit. From above doc dynamic resize is supported but I dont see a way to define the rule (e.g. > 90% PV disk usage) or set the max limit (e.g. dont resize if you reach 300GB). It looks like the resize command needs to be manually executed. Is my understanding correct ?

I know we could implement this by monitoring kubelete_volume_* metrics , Define a Alert based on our threshold, And have the alert event trigger the PV resize API.

But it could be cool if K8S supported this out of the box. This is very similar to auto scaling the containers based on load rules we define. They just need to extend this concept to volumes

-- Sandeep Bangera
kubernetes

0 Answers