1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-15 17:51:03 +00:00
kube-arangodb/scripts/kube_create_storage.sh

25 lines
723 B
Bash
Raw Normal View History

2018-03-08 14:59:04 +00:00
#!/bin/bash
# Create the local storage in the cluster if the cluster needs it.
NS=$1
if [ -z $NS ]; then
echo "Specify a namespace argument"
exit 1
fi
# Fetch cluster config
mapname="arango-operator-test"
eval $(kubectl get configmap $mapname -n kube-system --ignore-not-found --template='{{ range $key, $value := .data }}export {{$key}}={{$value}}
{{ end }}')
if [ "${REQUIRE_LOCAL_STORAGE}" = "1" ]; then
echo "Preparing local storage"
2018-03-09 09:05:13 +00:00
kubectl apply -n $NS -f examples/arango-local-storage.yaml || exit 1
2018-03-08 14:59:04 +00:00
else
echo "No local storage needed for this cluster"
fi
2018-06-08 07:37:20 +00:00
echo "Found $(kubectl get pv | wc -l) PersistentVolumes"
echo "Found $(kubectl get pv | grep Available | wc -l) available PersistentVolumes"