Last active
June 30, 2022 10:20
-
-
Save MrHassanMurtaza/8f8d29c07b44aff7e37b82350b76f572 to your computer and use it in GitHub Desktop.
Remove claimRef from all persistent volumes using kubectl
This file contains hidden or 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
#!/bin/bash | |
set -ex | |
for i in $(kubectl get pv | awk '{print $1}'); | |
do | |
kubectl patch pv $i --type=json -p '[{"op": "remove", "path": "/spec/claimRef"}]' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment