wip: convert ekman to new cluster sturcture (not complete)

This commit is contained in:
Jonas Juselius
2025-09-12 12:53:56 +02:00
parent 899a7f4338
commit ba5f1b8add
95 changed files with 150 additions and 150 deletions

45
ekman/bin/teardown.sh Executable file
View File

@@ -0,0 +1,45 @@
#!/usr/bin/env bash
TOP="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.."
reboot=no
case $1 in
--reboot) reboot=yes; shift ;;
esac
if [ $# != 1 ]; then
echo "usage: teardown.sh [--reboot] name"
exit 1
fi
d=$1
tmp=$TOP/.$d.$$
teardown () {
mkdir -p $tmp
cp -r $TOP/$d/* $tmp
sed -i '/k8s *= *{/,+1 s/enable *= *true/enable = false/' $tmp/cluster.nix
nixops modify -d $d $tmp
nixops deploy -d $d
[ $reboot = yes ] && nixops reboot -d $d
nixops ssh-for-each -d $d \
"rm -rf /var/run/kubernetes /var/lib/kubernetes /var/lib/etcd /var/lib/kubelet /var/lib/cfssl"
rm -rf $tmp
}
cat << EOF
************************************************************************
*** ***
*** WARNING: This will irrevokably destroy the running cluster! ***
*** ***
************************************************************************
EOF
echo "Are you sure you want to tear down $d? (YES/no)"
read a
case $a in
YES) teardown ;;
*) echo "Bailing out." ;;
esac