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
|