Skip to content

Instantly share code, notes, and snippets.

@jzoric
jzoric / pvc_checker.sh
Created May 25, 2021 14:17
Unused pvc
#!/bin/bash
for i in $(kubectl get pvc --no-headers | awk '{print $1}');do
kubectl describe pvc $i | grep "Used By" | awk -v pod=$i '$3=="<none>" { print "PVC " pod " not used"}'
done;

Keybase proof

I hereby claim:

  • I am jzoric on github.
  • I am jzoric (https://keybase.io/jzoric) on keybase.
  • I have a public key ASBfDyhHwt8MNTkAvPOdPRrxOOKlP33KNQ5V68X6xpS4cAo

To claim this, I am signing this object: