changed paths away from /Users/dtookey/go

This commit is contained in:
dtookey 2024-09-03 10:32:02 -04:00
parent 482632afd1
commit 05f9d5fab6
11 changed files with 48 additions and 38 deletions

View File

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

View File

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

View File

@ -25,10 +25,10 @@ fi
rm /Volumes/system-boot/user-data /Volumes/system-boot/network-config 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 ~/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/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,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" sed -i -e 's,cupidX,cupid'${CUPID_ID}',g' "${FILE_PATH}/user-data"
rm ${FILE_PATH}/*-e rm ${FILE_PATH}/*-e

View File

@ -1,8 +1,8 @@
#! /usr/bin/env bash #! /usr/bin/env bash
PROJECT_ROOT=$GOPATH/src/mlog
USER=virgil USER=virgil
cd ~/infra || exit
# Function to display usage # Function to display usage
usage() { usage() {
@ -18,7 +18,7 @@ while getopts "n:" opt; do
esac esac
done done
rsync -avP infra/ubuntu/autoinstaller-generate.sh atlas:/olympus/samba/linux/ag.sh rsync -avP 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/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" 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 #! /usr/bin/env bash
BUILD_ROOT=~/build BUILD_ROOT=~/build
PROJECT_ROOT=$GOPATH/src/mlog PROJECT_ROOT=~/infra
USER=virgil USER=virgil
@ -24,6 +24,6 @@ cd $BUILD_ROOT || exit
rm ${HOST_NAME}.iso || true rm ${HOST_NAME}.iso || true
sudo chown dtookey:dtookey ./* 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 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 #!/usr/bin/env bash
set -xe set -xe
cd $GOPATH/src/mlog || exit cd ~/infra || exit
USER_NAME=virgil USER_NAME=virgil
#clear out old known_host entries #clear out old known_host entries
ssh-keygen -f "/home/dtookey/.ssh/known_hosts" -R "10.1.1.2" || true 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\"" 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 "fix infra/scripts/setup/kube_worker.sh and then run the following command:"
echo "scripts/setup/1-finish-config.sh" echo "scripts/setup/1-finish-config.sh -t sha:alphabettispaghetti1234567890"

View File

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

View File

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

View File

@ -1,8 +1,5 @@
#! /usr/bin/env bash #! /usr/bin/env bash
PROJECT_ROOT=$GOPATH/src/mlog
# Function to display usage # Function to display usage
usage() { usage() {
echo "Usage: $0 -n <host_name>" echo "Usage: $0 -n <host_name>"
@ -26,4 +23,4 @@ rm ~/.kube/config
rsync -avP ${HOST_NAME}:~/.kube/config ~/.kube/config rsync -avP ${HOST_NAME}:~/.kube/config ~/.kube/config
kubectl taint nodes ${HOST_NAME} leader=:NoSchedule kubectl taint nodes ${HOST_NAME} leader=:NoSchedule

View File

@ -1,8 +1,5 @@
#! /usr/bin/env bash #! /usr/bin/env bash
PROJECT_ROOT=$GOPATH/src/mlog
# Function to display usage # Function to display usage
usage() { usage() {
echo "Usage: $0 -n <host_name>" echo "Usage: $0 -n <host_name>"
@ -10,9 +7,10 @@ usage() {
} }
# Parse command-line arguments # Parse command-line arguments
while getopts "n:r:" opt; do while getopts "n:r:t:" opt; do
case $opt in case $opt in
n) HOST_NAME="$OPTARG" ;; n) HOST_NAME="$OPTARG" ;;
t) JTOKEN="$OPTARG" ;;
r) ROLE="$OPTARG" ;; r) ROLE="$OPTARG" ;;
*) usage ;; *) usage ;;
esac esac
@ -24,10 +22,15 @@ if [ -z $HOST_NAME ]; then
exit exit
fi 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") 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 if [ ! -z $ROLE ]; then
kubectl taint node ${HOST_NAME} ${ROLE}=:NoSchedule kubectl taint node ${HOST_NAME} ${ROLE}=:NoSchedule
fi fi

View File

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