Skip to content

Instantly share code, notes, and snippets.

@rgpower
Created October 8, 2023 12:27
Show Gist options
  • Save rgpower/96e4ed3bc1b21264f3233310ff862803 to your computer and use it in GitHub Desktop.
Save rgpower/96e4ed3bc1b21264f3233310ff862803 to your computer and use it in GitHub Desktop.
delete all pod disruption budges
for pdb in $(kubectl get pdb --all-namespaces -o json | \
jq -r '.items[] | select(.status.disruptionsAllowed<1) | [.metadata.namespace,.metadata.name] | join("/")'); \
do kubectl -n "${pdb%%/*}" delete pdb/"${pdb##*/}"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment