#!/bin/sh apt-get update apt-get install -y vim cat << EOF | tee /etc/modules-load.d/k8s.conf overlay br_netfilter EOF modprobe overlay modprobe br_netfilter cat < config.toml cp config.toml /etc/containerd test -f containerd.service || wget https://raw.githubusercontent.com/containerd/containerd/main/containerd.service cp containerd.service /etc/systemd/system/ systemctl daemon-reload systemctl enable --now containerd test -f runc.amd64 || wget https://github.com/opencontainers/runc/releases/download/v1.1.10/runc.amd64 install -m 755 runc.amd64 /usr/local/sbin/runc test -f cni-plugins-linux-amd64-v1.4.0.tgz || wget https://github.com/containernetworking/plugins/releases/download/v1.4.0/cni-plugins-linux-amd64-v1.4.0.tgz mkdir -p /opt/cni/bin tar Cxzvf /opt/cni/bin cni-plugins-linux-amd64-v1.4.0.tgz sed -i.bak "s/SystemdCgroup.*$/SystemdCgroup = true/g" /etc/containerd/config.toml systemctl restart containerd apt-get update apt-get install -y apt-transport-https ca-certificates curl gpg mkdir -p /etc/apt/keyrings test -f /etc/apt/keyrings/kubernetes-apt-keyring.gpg || ( curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | gpg --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 apt-get update apt-get install -y kubelet=1.28.4-1.1 kubeadm=1.28.4-1.1 kubectl=1.28.4-1.1 swapoff -a sed -i.bak -E "s/^.*swap.*//g" /etc/fstab