Last active
June 2, 2017 15:00
-
-
Save xetys/f9b96637036718ca4c4c7edd6d7b808e to your computer and use it in GitHub Desktop.
The most ugliest dynamic storage provider for kubernetes (installed by kismatic enterprise toolkit)
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 | |
while true; do | |
kubectl get pvc --all-namespaces -o json | jq '.items[] | select(.metadata.annotations["volume.beta.kubernetes.io/storage-class"]=="auto-provision" and .status.phase=="Pending")' | jq -r '[.metadata.name, .spec.resources.requests.storage] | @csv' | sed s/\"//g | sed s/Gi//g | sed s/-pvc/-pv/ | awk -F ',' '{ print "./kismatic volume add " $2 " " $1 " -r 1 -d 2 -c=\"auto-provision\" -a 10.10.*.*"}' | sh | |
sleep 10 | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment