Compare commits

..

2 Commits

Author SHA1 Message Date
dtookey
05f9d5fab6 changed paths away from /Users/dtookey/go 2024-09-03 10:32:02 -04:00
dtookey
482632afd1 Removed useless helm install during ubuntu bootstrapping 2024-09-03 09:43:27 -04:00
12 changed files with 48 additions and 45 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
PATH_ROOT=$GOPATH/src/mlog/infra/kubes/ingress
PATH_ROOT=~/infra/kubes/ingress
cd $PATH_ROOT || exit

View File

@ -1,7 +1,6 @@
#! /usr/bin/env bash
PROJECT_ROOT=$GOPATH/src/mlog
cd ${PROJECT_ROOT}/infra/kubes/metallb || exit
cd ~/infra/kubes/metallb || exit
kubectl apply -f loadbalancer.yaml
kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey="$(openssl rand -base64 128)" || true

View File

@ -25,8 +25,8 @@ fi
rm /Volumes/system-boot/user-data /Volumes/system-boot/network-config
rsync -avP $GOPATH/src/mlog/infra/rpi/cupid/network-config.yaml "${FILE_PATH}/network-config"
rsync -avP $GOPATH/src/mlog/infra/rpi/cupid/user-data.yaml "${FILE_PATH}/user-data"
rsync -avP ~/infra/rpi/cupid/network-config.yaml "${FILE_PATH}/network-config"
rsync -avP ~/infra/rpi/cupid/user-data.yaml "${FILE_PATH}/user-data"
sed -i -e 's,10.1.1.x,10.1.1.'$(expr 4 + $CUPID_ID)',g' "${FILE_PATH}/network-config"
sed -i -e 's,cupidX,cupid'${CUPID_ID}',g' "${FILE_PATH}/user-data"

View File

@ -1,8 +1,8 @@
#! /usr/bin/env bash
PROJECT_ROOT=$GOPATH/src/mlog
USER=virgil
cd ~/infra || exit
# Function to display usage
usage() {
@ -18,7 +18,7 @@ while getopts "n:" opt; do
esac
done
rsync -avP infra/ubuntu/autoinstaller-generate.sh atlas:/olympus/samba/linux/ag.sh
rsync -avP "infra/ubuntu/user-data.${HOST_NAME}.yaml" atlas:/olympus/samba/linux/user-data || exit
rsync -avP ubuntu/autoinstaller-generate.sh atlas:/olympus/samba/linux/ag.sh
rsync -avP "ubuntu/user-data.${HOST_NAME}.yaml" atlas:/olympus/samba/linux/user-data || exit
ssh -t atlas "cd /olympus/samba/linux && sudo chmod a+x ./ag.sh && ./ag.sh -a -u ./user-data -d ${HOST_NAME}.iso && rm ag.sh user-data"

View File

@ -1,6 +1,6 @@
#! /usr/bin/env bash
BUILD_ROOT=~/build
PROJECT_ROOT=$GOPATH/src/mlog
PROJECT_ROOT=~/infra
USER=virgil
@ -24,6 +24,6 @@ cd $BUILD_ROOT || exit
rm ${HOST_NAME}.iso || true
sudo chown dtookey:dtookey ./*
rsync -avP "$PROJECT_ROOT/infra/ubuntu/autoinstaller-generate.sh" ./ag.sh
rsync -avP "$PROJECT_ROOT/ubuntu/autoinstaller-generate.sh" ./ag.sh
chmod a+x ./ag.sh
./ag.sh -a -u ${PROJECT_ROOT}/infra/ubuntu/user-data.${HOST_NAME}.yaml -d ${HOST_NAME}.iso
./ag.sh -a -u ${PROJECT_ROOT}/ubuntu/user-data.${HOST_NAME}.yaml -d ${HOST_NAME}.iso

View File

@ -1,7 +1,8 @@
#!/usr/bin/env bash
set -xe
cd $GOPATH/src/mlog || exit
cd ~/infra || exit
USER_NAME=virgil
#clear out old known_host entries
ssh-keygen -f "/home/dtookey/.ssh/known_hosts" -R "10.1.1.2" || true
@ -26,9 +27,9 @@ ssh cupid3 "echo \"cupid3 checked in\""
ssh cupid4 "echo \"cupid4 checked in\""
parallel -a infra/groups/all ./scripts/deploy/finish_preseeded_ubuntu.sh -n {}
parallel -a infra/groups/all ./scripts/setup/finish_preseeded_ubuntu.sh -n {}
./scripts/deploy/kube_leader.sh -n ares
./scripts/setup/kube_leader.sh -n ares
echo "fix infra/scripts/deploy/kube_worker.sh and then run the following command:"
echo "scripts/setup/1-finish-config.sh"
echo "fix infra/scripts/setup/kube_worker.sh and then run the following command:"
echo "scripts/setup/1-finish-config.sh -t sha:alphabettispaghetti1234567890"

View File

@ -1,8 +1,23 @@
#!/usr/bin/env bash
set -xe
cd $GOPATH/src/mlog || exit
#parallel -a ./infra/groups/workers ./scripts/deploy/kube_worker.sh -n {} -r worker
#parallel -a ./infra/groups/compute ./scripts/deploy/kube_worker.sh -n {} -r compute
cd || 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 ./infra/groups/workers ./scripts/setup/kube_worker.sh -n {} -r worker -t $JTOKEN
parallel -a ./infra/groups/compute ./scripts/setup/kube_worker.sh -n {} -r compute -t $JTOKEN
kubectl apply -f infra/kubes/dns/flannel.yaml
kubectl apply -f infra/kubes/dns/kube-dns.yaml

View File

@ -1,8 +1,5 @@
#! /usr/bin/env bash
PROJECT_ROOT=$GOPATH/src/mlog
# Function to display usage
usage() {
echo "Usage: $0 -n <host_name>"
@ -17,7 +14,7 @@ while getopts "n:" opt; do
esac
done
rsync -avP ./infra/ubuntu/bootstrap-ubuntu.sh ${HOST_NAME}:~/
rsync -avP ~/infra/ubuntu/bootstrap-ubuntu.sh ${HOST_NAME}:~/
ssh ${HOST_NAME} "sudo /bin/bash ./bootstrap-ubuntu.sh"

View File

@ -1,8 +1,5 @@
#! /usr/bin/env bash
PROJECT_ROOT=$GOPATH/src/mlog
# Function to display usage
usage() {
echo "Usage: $0 -n <host_name>"

View File

@ -1,8 +1,5 @@
#! /usr/bin/env bash
PROJECT_ROOT=$GOPATH/src/mlog
# Function to display usage
usage() {
echo "Usage: $0 -n <host_name>"
@ -10,9 +7,10 @@ usage() {
}
# Parse command-line arguments
while getopts "n:r:" opt; do
while getopts "n:r:t:" opt; do
case $opt in
n) HOST_NAME="$OPTARG" ;;
t) JTOKEN="$OPTARG" ;;
r) ROLE="$OPTARG" ;;
*) usage ;;
esac
@ -24,9 +22,14 @@ if [ -z $HOST_NAME ]; then
exit
fi
if [ -z $JTOKEN ]; then
echo "Please provide the join token with -t i.e. script.sh -t sha256:63acb4dee8a6d0870f2a3312fd9091fabf443712cd2a9de74c3cf13ed33124b6"
exit
fi
SERVER_TOKEN=$(ssh ares "sudo kubeadm token create")
ssh ${HOST_NAME} "sudo kubeadm join 10.1.1.2:6443 --token ${SERVER_TOKEN} --discovery-token-ca-cert-hash sha256:63acb4dee8a6d0870f2a3312fd9091fabf443712cd2a9de74c3cf13ed33124b6"
ssh ${HOST_NAME} "sudo kubeadm join 10.1.1.2:6443 --token ${SERVER_TOKEN} --discovery-token-ca-cert-hash $JTOKEN"
if [ ! -z $ROLE ]; then
kubectl taint node ${HOST_NAME} ${ROLE}=:NoSchedule

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
cd $GOPATH/src/mlog || exit
ssh ares "sudo efibootmgr --bootnext 000B > /dev/null"
ssh ares "sudo shutdown -r now"

View File

@ -81,10 +81,3 @@ systemctl enable kubelet && systemctl start kubelet
kubeadm config images pull
fi
if [ -z "$(which helm)" ]; then
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /etc/apt/keyrings/helm.gpg > /dev/null
sudo chmod 644 /etc/apt/keyrings/helm.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install -y helm
fi