Created
March 6, 2019 12:04
-
-
Save Pamir/3a7e6cac7acd21e9eefa4af0bc13df25 to your computer and use it in GitHub Desktop.
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 | |
dump_pvinfo(){ | |
namespace=$1 | |
for pvc in $(kubectl get pvc -o=jsonpath="{.items[*].metadata.name}" -n $namespace); do | |
echo " " $pvc | |
pv=$(kubectl get pvc -o=jsonpath="{.spec.volumeName}" -n $namespace $pvc) | |
echo " " $pv | |
pdName=$(kubectl get pv -o=jsonpath="{.spec.gcePersistentDisk.pdName}" -n $namespace $pv) | |
echo " " $pdName | |
done; | |
} | |
for namespace in $(kubens); do | |
echo $namespace | |
dump_pvinfo $namespace | |
done; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment