From fa6a816e169120120119cf2f05a798b6e305dd50 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Fri, 22 Apr 2022 11:04:19 -0300 Subject: [PATCH] First working version --- check_full_pvs.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/check_full_pvs.sh b/check_full_pvs.sh index 0addbc7..69ec026 100755 --- a/check_full_pvs.sh +++ b/check_full_pvs.sh @@ -131,12 +131,13 @@ for ns in $ALLNS; do pvcstatus=$(kubectl get pvc $pvcname -n $ns -o=jsonpath='{.status.conditions[0].type}') if [[ "$pvcstatus" == 'Resizing' ]]; then echo " |-- Volume $pvcname already has a Resizing operation going on." - restartforresize $ns deployment $pvcname - restartforresize $ns statefulset $pvcname else newsize=$(echo ${size}*1.${INCREASEPERC}| bc | grep -v "$\.0") - echo " |-- Resizing $pvcname: ${size}Gi --> ${newsize}Gi..." + echo -n " |-- Resizing $pvcname: ${size}Gi --> ${newsize}Gi..." && \ + kubectl patch pvc -n $ns $pvcname -p '{ "spec": { "resources": { "requests": { "storage": "'${newsize}'Gi" }}}}' fi + restartforresize $ns deployment $pvcname + restartforresize $ns statefulset $pvcname fi fi done