1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00
kube-arangodb/scripts/kube_create_storage.sh
2018-03-09 10:05:13 +01:00

22 lines
582 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