Skip to content

Commit

Permalink
Update initial-node-setup.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui authored Nov 17, 2023
1 parent 081c09a commit 5eb32e0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions initial-node-setup.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 5eb32e0

Please sign in to comment.