Last active
March 31, 2024 02:27
-
-
Save GuyPaddock/d749ebaed0b209fd7fa81df71d82065f to your computer and use it in GitHub Desktop.
Delete Kubernetes PVs that Match Specific Naming Pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -uo pipefail | |
PATTERN="${1}" | |
echo "${PATTERN}" | |
echo kubectl delete pvc $(kubectl get pvc | grep "${PATTERN}" | awk '{ print $1 }') | |
echo kubectl delete pv $(kubectl get pv | grep "${PATTERN}" | awk '{ print $1 }') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment