Skip to content

Instantly share code, notes, and snippets.

@jpclipffel
Last active February 4, 2021 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpclipffel/e3dba9c56d9af9e0c68984be05bc5d6c to your computer and use it in GitHub Desktop.
Save jpclipffel/e3dba9c56d9af9e0c68984be05bc5d6c to your computer and use it in GitHub Desktop.
Delete stale PVC
for pvc in $(kubectl get pvc | tail -n+2 | awk '{print $1}'); do
kubectl patch pvc ${pvc} -p '{"metadata":{"finalizers": []}}' --type=merge
kubectl delete pvc ${pvc}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment