infra/scripts/setup/1-finish-config.sh
2024-09-03 16:00:52 -04:00

41 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -xe
cd ~/infra || exit
# Parse command-line arguments
while getopts "n:r:t:" opt; do
case $opt in
t) JTOKEN="$OPTARG" ;;
*) usage ;;
esac
done
if [ -z $JTOKEN ]; then
echo "Please provide the join token with -t i.e. script.sh -t sha256:63acb4dee8a6d0870f2a3312fd9091fabf443712cd2a9de74c3cf13ed33124b6"
exit
fi
parallel -a groups/workers ./scripts/setup/kube_worker.sh -n {} -r worker -t $JTOKEN
parallel -a groups/compute ./scripts/setup/kube_worker.sh -n {} -r compute -t $JTOKEN
echo "Waiting for 30s for the new pods to settle"
sleep 10
echo "20s remaining..."
sleep 10
echo "10s remaining..."
sleep 10
kubectl apply -f kubes/dns/flannel.yaml
kubectl apply -f kubes/dns/kube-dns.yaml
./kubes/cni/install.sh
kubectl patch deployment coredns -n kube-system --type json --patch "$(cat kubes/dns/coredns-tolerations.json)"
kubectl patch deployment calico-kube-controllers -n kube-system --type json --patch "$(cat kubes/dns/coredns-tolerations.json)"
./kubes/metallb/install.sh
./kubes/ingress/install.sh