The most ugliest dynamic storage provider for kubernetes (installed by kismatic enterprise toolkit)
#!/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