Compare commits

..

No commits in common. "05f9d5fab6c148a2e5a911f9477ce93429ab576f" and "4309f87777f3ebc0cc7cb581e644fd7e2be18810" have entirely different histories.

12 changed files with 45 additions and 48 deletions

View File

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

View File

@ -1,6 +1,7 @@
#! /usr/bin/env bash
cd ~/infra/kubes/metallb || exit
PROJECT_ROOT=$GOPATH/src/mlog
cd ${PROJECT_ROOT}/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

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

View File

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

View File

@ -1,5 +1,7 @@
#!/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

@ -25,8 +25,8 @@ fi
rm /Volumes/system-boot/user-data /Volumes/system-boot/network-config
rsync -avP ~/infra/rpi/cupid/network-config.yaml "${FILE_PATH}/network-config"
rsync -avP ~/infra/rpi/cupid/user-data.yaml "${FILE_PATH}/user-data"
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"
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 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
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
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=~/infra
PROJECT_ROOT=$GOPATH/src/mlog
USER=virgil
@ -24,6 +24,6 @@ cd $BUILD_ROOT || exit
rm ${HOST_NAME}.iso || true
sudo chown dtookey:dtookey ./*
rsync -avP "$PROJECT_ROOT/ubuntu/autoinstaller-generate.sh" ./ag.sh
rsync -avP "$PROJECT_ROOT/infra/ubuntu/autoinstaller-generate.sh" ./ag.sh
chmod a+x ./ag.sh
./ag.sh -a -u ${PROJECT_ROOT}/ubuntu/user-data.${HOST_NAME}.yaml -d ${HOST_NAME}.iso
./ag.sh -a -u ${PROJECT_ROOT}/infra/ubuntu/user-data.${HOST_NAME}.yaml -d ${HOST_NAME}.iso

View File

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

View File

@ -1,23 +1,8 @@
#!/usr/bin/env bash
set -xe
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
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
kubectl apply -f infra/kubes/dns/flannel.yaml
kubectl apply -f infra/kubes/dns/kube-dns.yaml

View File

@ -81,3 +81,10 @@ 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