|
|
@ -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 |
|
|
|