Browse Source

Fix issue with stale kubelet volume metrics

master
Fábio Kaiser Rauber 3 years ago
parent
commit
9d159be6a6
  1. 2
      check_full_pvs.sh

2
check_full_pvs.sh

@ -124,7 +124,7 @@ for ns in $ALLNS; do
for pv in $usedstr; do for pv in $usedstr; do
usedperc=$(echo "$pv" | awk '{print $10}') usedperc=$(echo "$pv" | awk '{print $10}')
pvcname=$(echo "$pv" | awk '{print $2}') pvcname=$(echo "$pv" | awk '{print $2}')
size=$(echo "$pv" | awk '{print $7}' | numfmt --from=iec-i --to=iec-i --to-unit=Gi --round=up) size=$(kubectl get pvc $pvcname -n $ns -o=jsonpath='{.status.capacity.storage}' | numfmt --from=iec-i --to=iec-i --to-unit=Gi --round=up)
if (( $(bc <<< "($usedperc > $FULLTHRESHOLD)") )); then if (( $(bc <<< "($usedperc > $FULLTHRESHOLD)") )); then
echo "Volume $pvcname is almost full: ${usedperc}%!" echo "Volume $pvcname is almost full: ${usedperc}%!"
if [ $FIX -ne 0 ]; then if [ $FIX -ne 0 ]; then

Loading…
Cancel
Save