Skip to content

Instantly share code, notes, and snippets.

@jengo
Last active May 25, 2019 18:47
Show Gist options
  • Save jengo/2080cb07228a0b8aafb9ea54858e70c5 to your computer and use it in GitHub Desktop.
Save jengo/2080cb07228a0b8aafb9ea54858e70c5 to your computer and use it in GitHub Desktop.
Modify all Kubernetes Persistent Volume to Retain policy
for f in $(kubectl get pv --no-headers -o custom-columns=NAME:.metadata.name); \
do kubectl patch pv $f -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment