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_configure_test_cluster.sh

29 lines
693 B
Bash
Raw Normal View History

2018-03-08 14:59:04 +00:00
#!/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
2018-03-09 08:12:47 +00:00
kubectl create configmap $mapname -n kube-system --from-env-file=$configfile || exit 1
2018-03-08 14:59:04 +00:00
echo Stored configuration:
2018-03-09 09:49:09 +00:00
cat $configfile
rm $configfile