From 8109669fa0398d7ccbe27c1b8401ffe22842b09e Mon Sep 17 00:00:00 2001 From: dtookey Date: Thu, 12 Sep 2024 09:57:15 -0400 Subject: [PATCH] adjusted bootstrap scripts to have well-defined lb vs ingress --- groups/{compute => ingress} | 0 groups/loadbalance | 1 + kubes/ingress/tolerations.yaml | 6 +++--- kubes/metallb/loadbalancer.yaml | 2 +- scripts/preseed/autoinstaller-generate.sh | 2 +- scripts/setup/0-install_kubes.sh | 5 +++-- scripts/setup/1-finish-config.sh | 4 +++- ubuntu/bootstrap-ubuntu.sh | 5 +++++ ubuntu/user-data.apollo.yaml | 13 ++----------- ubuntu/user-data.artemis.yaml | 14 ++------------ 10 files changed, 21 insertions(+), 31 deletions(-) rename groups/{compute => ingress} (100%) create mode 100644 groups/loadbalance diff --git a/groups/compute b/groups/ingress similarity index 100% rename from groups/compute rename to groups/ingress diff --git a/groups/loadbalance b/groups/loadbalance new file mode 100644 index 0000000..4c1cf01 --- /dev/null +++ b/groups/loadbalance @@ -0,0 +1 @@ +apollo diff --git a/kubes/ingress/tolerations.yaml b/kubes/ingress/tolerations.yaml index d4f01ac..88f6bc2 100644 --- a/kubes/ingress/tolerations.yaml +++ b/kubes/ingress/tolerations.yaml @@ -1,14 +1,14 @@ controller: tolerations: - effect: NoSchedule - key: compute + key: ingress admissionWebhooks: patch: tolerations: - effect: NoSchedule - key: compute + key: ingress defaultBackend: tolerations: - effect: NoSchedule - key: compute \ No newline at end of file + key: ingress diff --git a/kubes/metallb/loadbalancer.yaml b/kubes/metallb/loadbalancer.yaml index 0181126..f1073b0 100644 --- a/kubes/metallb/loadbalancer.yaml +++ b/kubes/metallb/loadbalancer.yaml @@ -1853,7 +1853,7 @@ spec: key: node-role.kubernetes.io/control-plane operator: Exists - effect: NoSchedule - key: compute + key: loadbalance volumes: - name: memberlist secret: diff --git a/scripts/preseed/autoinstaller-generate.sh b/scripts/preseed/autoinstaller-generate.sh index e73a0b5..c750545 100755 --- a/scripts/preseed/autoinstaller-generate.sh +++ b/scripts/preseed/autoinstaller-generate.sh @@ -289,7 +289,7 @@ fi log "📦 Repackaging extracted files into an ISO image..." cd "$tmpdir" -xorriso -as mkisofs -r -V 'Ubuntu-Server 24.04.1 LTS amd64' --modification-date='2024091107542800' --grub2-mbr --interval:local_fs:0s-15s:zero_mbrpt,zero_gpt:'/home/dtookey/infra/build/ubuntu-original-2024-09-11.iso' --protective-msdos-label -partition_cyl_align off -partition_offset 16 --mbr-force-bootable -append_partition 2 28732ac11ff8d211ba4b00a0c93ec93b --interval:local_fs:5526876d-5537019d::'/home/dtookey/infra/build/ubuntu-original-2024-09-11.iso' -appended_part_as_gpt -iso_mbr_part_type a2a0d0ebe5b9334487c068b6b72699c7 -c '/boot.catalog' -b '/boot/grub/i386-pc/eltorito.img' -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info -eltorito-alt-boot -e '--interval:appended_partition_2_start_1381719s_size_10144d:all::' -no-emul-boot -boot-load-size 10144 -o "${destination_iso}" . #&>/dev/null +xorriso -as mkisofs -r -V 'Ubuntu-Server 24.04.1 LTS amd64' --modification-date='2024091107542800' --grub2-mbr --interval:local_fs:0s-15s:zero_mbrpt,zero_gpt:'/home/dtookey/infra/build/ubuntu-original-2024-09-12.iso' --protective-msdos-label -partition_cyl_align off -partition_offset 16 --mbr-force-bootable -append_partition 2 28732ac11ff8d211ba4b00a0c93ec93b --interval:local_fs:5526876d-5537019d::'/home/dtookey/infra/build/ubuntu-original-2024-09-12.iso' -appended_part_as_gpt -iso_mbr_part_type a2a0d0ebe5b9334487c068b6b72699c7 -c '/boot.catalog' -b '/boot/grub/i386-pc/eltorito.img' -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info -eltorito-alt-boot -e '--interval:appended_partition_2_start_1381719s_size_10144d:all::' -no-emul-boot -boot-load-size 10144 -o "${destination_iso}" . #&>/dev/null cd "$OLDPWD" diff --git a/scripts/setup/0-install_kubes.sh b/scripts/setup/0-install_kubes.sh index 5a60eda..bf507cc 100755 --- a/scripts/setup/0-install_kubes.sh +++ b/scripts/setup/0-install_kubes.sh @@ -17,10 +17,11 @@ ssh -t ares "echo \"virgil ALL=(ALL) NOPASSWD:ALL\" | sudo tee /etc/sudoers.d/pa ssh ares "echo \"ares checked in\"" ssh -t artemis "echo \"virgil ALL=(ALL) NOPASSWD:ALL\" | sudo tee /etc/sudoers.d/passwordless > /dev/null" -ssh artemis "sudo sed -i -e 's/#HandleLidSwitch=suspend/HandleLidSwitch=ignore/g' /etc/systemd/logind.conf" -ssh artemis "sudo systemctl restart systemd-logind.service" ssh artemis "echo \"artemis checked in\"" +ssh -t apollo "echo \"virgil ALL=(ALL) NOPASSWD:ALL\" | sudo tee /etc/sudoers.d/passwordless > /dev/null" +ssh apollo "echo \"artemis checked in\"" + ssh cupid1 "echo \"cupid1 checked in\"" ssh cupid2 "echo \"cupid2 checked in\"" ssh cupid3 "echo \"cupid3 checked in\"" diff --git a/scripts/setup/1-finish-config.sh b/scripts/setup/1-finish-config.sh index 2d0eafe..8f12c02 100755 --- a/scripts/setup/1-finish-config.sh +++ b/scripts/setup/1-finish-config.sh @@ -17,7 +17,9 @@ if [ -z $JTOKEN ]; then 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 +parallel -a groups/compute ./scripts/setup/kube_worker.sh -n {} -r ingress -t $JTOKEN +parallel -a groups/compute ./scripts/setup/kube_worker.sh -n {} -r loadbalance -t $JTOKEN + echo "Waiting for 30s for the new pods to settle" sleep 10 diff --git a/ubuntu/bootstrap-ubuntu.sh b/ubuntu/bootstrap-ubuntu.sh index a32423e..89e1121 100644 --- a/ubuntu/bootstrap-ubuntu.sh +++ b/ubuntu/bootstrap-ubuntu.sh @@ -24,6 +24,7 @@ if [ -z "$(which docker)" ]; then # Add the repository to Apt sources: echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu noble stable" | \ tee /etc/apt/sources.list.d/docker.list > /dev/null + apt-get update apt-get install -y docker-ce docker-ce-cli containerd.io apt-transport-https usermod -aG docker ${USER_NAME} @@ -81,3 +82,7 @@ systemctl enable kubelet && systemctl start kubelet kubeadm config images pull fi + + +apt-get upgrade -y +apt-get autoremove -y diff --git a/ubuntu/user-data.apollo.yaml b/ubuntu/user-data.apollo.yaml index 1b3ccd6..66ccfe8 100644 --- a/ubuntu/user-data.apollo.yaml +++ b/ubuntu/user-data.apollo.yaml @@ -24,7 +24,7 @@ autoinstall: layout: name: lvm match: - size: smallest + path: /dev/sda sizing-policy: scaled config: - type: partition @@ -33,16 +33,7 @@ autoinstall: size: 1G - type: partition id: root-partition - size: 25G - storage: - layout: - name: lvm - match: - size: largest - config: - - type: partition - id: data-partition - size: 256G + size: 100G network: version: 2 renderer: networkd diff --git a/ubuntu/user-data.artemis.yaml b/ubuntu/user-data.artemis.yaml index 9057f10..ed96558 100644 --- a/ubuntu/user-data.artemis.yaml +++ b/ubuntu/user-data.artemis.yaml @@ -24,7 +24,7 @@ autoinstall: layout: name: lvm match: - size: smallest + path: /dev/sda sizing-policy: scaled config: - type: partition @@ -33,17 +33,7 @@ autoinstall: size: 1G - type: partition id: root-partition - size: 25G - storage: - layout: - name: lvm - match: - size: largest - model: CT* - config: - - type: partition - id: data-partition - size: 256G + size: 100G network: version: 2 renderer: networkd