clank-bootstrapper/clusterapi/initialize-hetzner.sh

32 lines
614 B
Bash
Raw Normal View History

2022-12-10 22:08:07 +01:00
#!/bin/bash
set -e
. variables.sh
sleep 20
OUTPUT_TEMPLATE=/tmp/clusterapi/clank-management.yaml
rm -rf "/tmp/clusterapi/" || true
echo "templating management cluster"
mkdir -p /tmp/clusterapi/
clusterctl generate cluster "$CLUSTER_NAME" > "$OUTPUT_TEMPLATE"
nvim /tmp/clusterapi/clank-management.yaml
read -p "Continue? (N/y) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo "aborting"
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi
kubectl apply -f "$OUTPUT_TEMPLATE"
kubectl wait --for=jsonpath='{.status.phase}'=Provisioned "cluster/$CLUSTER_NAME"
echo "cluster has been provisioned"