mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
24 lines
723 B
Bash
Executable file
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"
|