From 5eb32e0a15df7b8912a1ba8272942793fce3836f Mon Sep 17 00:00:00 2001 From: Josh Smith Date: Thu, 16 Nov 2023 21:38:49 -0500 Subject: [PATCH] Update initial-node-setup.sh --- initial-node-setup.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/initial-node-setup.sh b/initial-node-setup.sh index 04dc758..7ebb1d0 100644 --- a/initial-node-setup.sh +++ b/initial-node-setup.sh @@ -1,10 +1,16 @@ +#!/usr/bin/env bash +set -euxo pipefail + +# make sure this all runs noninteractively export DEBIAN_FRONTEND=noninteractive sudo apt -y remove needrestart +# update/upgrade the system sudo apt update && sudo apt dist-upgrade -y sudo apt install -y apt-transport-https ca-certificates curl gpg -curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg +# Install k8s tooling (kubelet, kubeadm, kubectl) +curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --yes --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo apt-get update sudo apt-get install -y kubelet kubeadm kubectl @@ -14,7 +20,7 @@ sudo apt-mark hold kubelet kubeadm kubectl sudo apt-get update sudo apt-get install -y ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --yes --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg # Add the repository to Apt sources @@ -23,9 +29,9 @@ echo \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update - sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +# Setup cri-dockerd cd /tmp wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.7/cri-dockerd-0.3.7.amd64.tgz tar -xvf cri-dockerd-0.3.7.amd64.tgz @@ -37,5 +43,4 @@ sudo sed -i -e 's,/usr/bin/cri-dockerd,/usr/local/bin/cri-dockerd,' /etc/systemd sudo systemctl daemon-reload sudo systemctl enable cri-docker.service sudo systemctl enable --now cri-docker.socket - sudo kubeadm config images pull --cri-socket /run/cri-dockerd.sock