Triggering auto-expansion of openshift persistent volumes

4/21/2020

I have deployed mysql stateful-set with one master and two slave pods. Each of the pod has their own Persistent Volume Claim(PVC) as per storage requested by user. I am able to expand any persistent volume by editing their respective PVC.

I am trying to implement a service to trigger auto-expansion of respective volume as soon as consumed storage of any pod crosses 90%. (Preferred in Java)

As per my investigation, I can use patch request for editing any PVC json file for desired storage. Also, Cron-Job can be created for checking the storage after fixed time interval, but this looks inefficient to me. It will be difficult and inefficient to monitor hundreds of pods for different users this way.

I am new to Openshit and Kubernetes, Please suggest, how to implement this with most efficiency.

-- Himanshu Jindal
java
kubernetes
kubernetes-pod
openshift
openshift-origin

0 Answers