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
2018-06-08 09:37:20 +02:00

24 lines
723 B
Bash
Executable file

#!/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"
kubectl apply -n $NS -f examples/arango-local-storage.yaml || exit 1
else
echo "No local storage needed for this cluster"
fi
echo "Found $(kubectl get pv | wc -l) PersistentVolumes"
echo "Found $(kubectl get pv | grep Available | wc -l) available PersistentVolumes"