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_configure_test_cluster.sh
Ewout Prangsma c3156e2ec5
Cleanup
2018-03-09 10:49:09 +01:00

28 lines
693 B
Bash
Executable file

#!/bin/bash
# Sets the configuration of the cluster in a ConfigMap in kube-system.
cluster=$(kubectl config current-context)
echo "Configuring cluster $cluster"
read -p "Does the cluster require local storage (Y/n)? " answer
case ${answer:0:1} in
n|N )
REQUIRE_LOCAL_STORAGE=
;;
* )
REQUIRE_LOCAL_STORAGE=1
;;
esac
mapname="arango-operator-test"
configfile=$(mktemp)
cat <<EOF > $configfile
REQUIRE_LOCAL_STORAGE=${REQUIRE_LOCAL_STORAGE}
EOF
kubectl delete configmap $mapname -n kube-system --ignore-not-found
kubectl create configmap $mapname -n kube-system --from-env-file=$configfile || exit 1
echo Stored configuration:
cat $configfile
rm $configfile