Adding a new node running Ubuntu 22.04 to Kubernetes version 1.25.0 cluster.
swapoff -a
sed -i 's/\/swap.img/#\/swap.img/g' /etc/fstab
echo 1 > /proc/sys/net/ipv4/ip_forward
modprobe overlay
modprobe br_netfilter
sysctl --system
apt install -y curl gnupg2 software-properties-common apt-transport-https ca-certificates
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt update -y
apt install -y containerd
mkdir /etc/containerd
containerd config default > /etc/containerd/config.toml
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/g' /etc/containerd/config.toml
systemctl restart containerd
systemctl enable containerd
apt -y install curl vim git wget apt-transport-https gpg
mkdir /etc/apt/keyrings
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.25/deb/Release.key | sudo 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.25/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
apt update -y
apt install -y kubelet=1.25.16-1.1 kubeadm=1.25.16-1.1
apt-mark hold kubelet kubeadm kubectl
systemctl enable kubelet
kubeadm join <IP>:6443 --token <TOKEN> --discovery-token-ca-cert-hash sha256:<SHA256>
Hope this help.